f2s_esql_row_count

Applies to: Oracle, MS SQL is Not Available in Beta, MySql/MariaDB, PostgreSQL Drivers

Syntax

f2s_esql_row_count {variable} [using {variant}]

Parameter

Description

variable

The integer variable for the returned row count from the SQL result set

variant

Optional variant type variable that will receive a statement interface

Description

This command returns the row count from the executed SQL statement.

The required “using” syntax allows you to pass around the interface created by this command. The variable passed MUST be a variant. This allows for multiple statements to be active concurrently in some cases. If you use the “using” syntax, it must be used on all subsequent commands. Mixing the using syntax is not supported. So for instance, if you plan on having multiple statements active concurrently, all active statements must make use of the using syntax.

SQL statements can end up being very long and complicated in some cases. Working with these large statements can be cumbersome in DataFlex because of line continuation syntax. This can also hinder readability. To make things easier, you can use the ImageToString function in the cMertechImageParser.pkg package to allow loading of SQL statements from DataFlex images. See the example below for this use.

Example
     Variant vStat
     Variant[] vRow
     String sVal
     Integer iResultSetRowCount

     f2s_esql_create_stmt "Select * from sys.databases" using vStat
     f2s_esql_set_cursor_type f2s_olecursor_server using vStat
     f2s_esql_prepare_stmt using vStat

     f2s_esql_execute_stmt using vStat
     f2s_esql_row_count iResultSetRowCount using vStat
     Showln "Number of sys.databases returned = " iResultSetRowCount


     f2s_esql_close_stmt using vStat
     inkey windowIndex

Related Commands

Replaces: Command None