sqldynnparms() — Get the Number of Parameter Markers
Gets the number of parameter markers in a prepared dynamic ESQL statement.
This function returns normalized values. For more information, see the function return values in the "General Diagnostics" section in this chapter:
sqln
A pointer to the request handle that a previous call to
sqldynprep()
returns. For more information on request handles, see the "SQL Request Handles" section.nparms
A pointer to an integer to receive the number of parameter markers in the prepared statement.
NOTES
EXAMPLE
- If the statement associated with
sqln
does not contain parameter markers,sqldynnparms()
sets nparms to 0.- You must call
sqldynprep()
prior to any call tosqldynnparms()
.- If you are using the preprocessor and are preparing and executing SQL requests using dynamic ESQL statements, the request handles are not available at development time, only the statement identifiers. (The preprocessor generates the request handles.) To call
sqldynnparms()
in this case, first callsqlgetrqhdl()
to obtain the request handles for prepared statements to which the statement identifier refers.This example prepares a cursor specification and returns the number of dynamic parameter markers in the WHERE clause to
nparams
.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
sqldynncols() — Get the Number of Columns in a Result Set, sqldynprep() — Prepare a Dynamic SQL Statement, sqlgetrqhdl() — Get a Dynamic Request Handle
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |