SQL_BINDCOLUMNS_STMT¶
Applies to: ORAFlex SQLFlex MYSQLFlex PGFlex DB2Flex
This command is used to fetch the returned data of a specified SQL expression into the given field in the record buffer. By passing any number of fields to this command, the fetched record will then be put into the subsequent fields in the record buffer. The order of the fields must be the same as the order of the columns being retrieved from the SQL expression. SQL_FETCH_NEXT_ROW can then be called to take the data retrieved from the server and place it into the corresponding fields in the buffer. Instead of specifying each field, DF_BIND_ALL_COLUMNS can be passed, which will retrieve every column in the table.
Syntax
SQL_BINDCOLUMNS_STMT of {file} to {field/DF_BIND_ALL_COLUMNS}
Parameter |
Description |
---|---|
file |
Name or number of the file |
field |
Name or number of the field (can be multiple) |
DF_BIND_ALL_COLUMNS |
Used instead of the field to retrieve all columns in the file |
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