Variables in dynamic SQL
In dynamic SQL statements, parameter markers are used instead of variables. A parameter marker is a question mark (?) that represents a position in a dynamic SQL statement where the application will provide a value; that is, where a variable would be found if the statement string were a static SQL statement.
The following examples shows a static SQL that uses host variables and a dynamic statement that uses parameter markers:
INSERT INTO DEPT
VALUES( :HV_DEPTNO, :HV_DEPTNAME, :HV_MGRNO:IND_MGRNO, :HV_ADMRDEPT)
INSERT INTO DEPT
VALUES( ?, ?, ?, ? )
For more information about parameter markers, see Parameter Markers, in PREPARE.