Dynamic EXECUTE Statement
The dynamic EXECUTE statement executes any SQL statements other than cursor specifications that you prepare using the PREPARE statement. The preprocessor generates a call to
sqldynexec()
for this statement.Following is the syntax for the dynamic EXECUTE statement:
statement-name
A statement identifier previously defined in a PREPARE statement. The scope of a statement identifier (used also in the DESCRIBE and DECLARE CURSOR statements) extends to the entire ESQL source file. Any reference to this statement identifier in any function within the file references the same prepared statement.
structure-name
If the prepared statement contains dynamic parameter markers, the structure-name is the name of an SQLDA_T structure that contains the values to be supplied for those parameter markers.
host-var-ref
Host language variable references (including any indicator variables) are used to supply values for dynamic parameter markers, if any, in the prepared statement. These variables must appear in the SQL Declare section of your ESQL application. For more information, see the "Host Language Variables" and "Indicator Variables" sections in this chapter.
ind-var-ref
An indicator variable provides information about a host language variable that is not representable in the host language variable value itself. You declare indicator variables like host language variables in an SQL Declare section, and declare them as C numeric types. Indicator types can be long, short, sqldec, float, or double. For information on declaring host language variables, see the "Host Language Variables" section in this chapter.
When using the SQLDA_T structure, the EXECUTE statement expects the DATA member of the SQLVAR_T structure for each column to point to the target storage for the data value returned. It also expects the INDICATOR member to point to a long (which you can set to 0 or -1), if the program allocates storage for INDICATOR.
CAUTION: Any bad pointer values in DATA or INDICATOR members can lead to unpredictable application behavior.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |