sqlgetrqhdl() — Get a Dynamic Request Handle
Gets a request handle corresponding to a prepared dynamic ESQL statement identifier.
This function returns normalized values. For more information, see the function return values in the "General Diagnostics" section in this chapter.
pstmtid
A pointer to an SQL statement identifier used in dynamic ESQL statements and registered to the ESQL-LIB interface with a previous call to
sqldynprep()
.sqln
The address of a pointer to the request handle corresponding to the specified statement identifier. For more information on request handles, see the "SQL Request Handles" section.
NOTE
EXAMPLEThis example retrieves the request handle for a prepared cursor specification in order to get the number of parameter markers in the request. The example assumes that you have prepared the request using the PREPARE statement, before the preprocessor has defined and returned the request handle to
sql1
. However, the code itself is preprocessed, and that is why rqhandle, to whichsqlgetrqhdl()
returns the same request handle, appears redundant. If you call ESQL-LIB directly to implement dynamic SQL requests, you define and use your own request handle variables from the beginning and do not need to callsqlgetrqhdl():
In this example, the parameter markers in the request are hard-coded to show their presence. In reality, the request string might be conditionally assembled from several code points, making the presence and number of parameter markers truly unknown when the request is prepared.
SEE ALSO
sqldynprep() — Prepare a Dynamic SQL Statement, sqldynnparms() — Get the Number of Parameter Markers
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |