SQL_EXECUTE_STMT¶

Applies to: ORAFlex SQLFlex MYSQLFlex PGFlex DB2Flex

This command is used to execute the SQL expression created by the SQL_SET_STMT and any subsequent SQL_APPEND_STMT commands issued after a SQL_PREPARE_STMT. If the results will be sent to the record buffer directly, then the file must be specified. An optional parameter can also be passed, indicating the maximum number of rows to be sent to the local cache. This is done by adding the constant ROWCOUNT followed by the maximun number.

Syntax

SQL_EXECUTE_STMT [of {file} ROWCOUNT {variable}]

Parameter

Description

file

Name or number of the file (optional)

variable

Maximum number of rows to send to the local cache (optional)

Usage

SQL_EXECUTE_STMT
SQL_EXECUTE_STMT of Customer
SQL_EXECUTE_STMT of Customer ROWCOUNT 10

Example

Open Customer

SQL_SET_STMT         of Customer to "SELECT * FROM CUSTOMER WHERE STATUS = 'Active' "
SQL_PREPARE_STMT     of Customer
SQL_BINDCOLUMNS_STMT of Customer to DF_BIND_ALL_COLUMNS
SQL_EXECUTE_STMT     of Customer
While (Found)
    SQL_FETCH_NEXT_ROW of Customer
    Showln Customer.ID
    Showln Customer.FirstName
    Showln Customer.LastName
    Showln Customer.DOB
Loop
SQL_CANCEL_QUERY_STMT