Using Dynamic Parameter Markers

Dynamic parameter markers allow an ESQL application to prepare a dynamic ESQL statement once and execute it multiple times, with different values for the parameter markers each time the request executes. Therefore you bypass the extra compilation overhead for each new set of values. Dynamic parameter markers are represented with the question mark (?).

For example, consider the following dynamic ESQL request string:

char *prequest;
prequest = "SELECT name FROM customer WHERE cust\-num > ?"; 

To execute such a request, you have to prepare it, declare a cursor for it, and execute it like any cursor SELECT. However, you also have to specify a host language variable list or SQL descriptor area to provide new input values for the parameter markers each time you execute the request.

The following sections describe where in SQL you can use parameter markers and how to use them in your application.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095