base.SqlHandle.setParameter

Sets the value of an SQL parameter for this SQL handle.

Syntax

setParameter(
   index INTEGER,
   value fgl-type )
  1. index is the ordinal position of the ? SQL parameter (starts at 1).
  2. value is the variable containing the parameter value.

Usage

Call the setParameter() method to define the value of an SQL parameter specified with a ? place holder in the string passed to the prepare() method.

The SQL statement must have been prepared with a prepare() call.

It is possible to pass numeric and string constants directly to the method, but type conversion cannot be done without a program variable.

Example

DEFINE v_pk INT, v_crea DATETIME YEAR TO SECOND
...
CALL sh.setParameter(1,v_pk)
CALL sh.setParameter(2,v_crea)