SQL Programming Manual for Pascal
Host Variables and Parameters
HP NonStop SQL Programming Manual for Pascal—528614-001
2-12
Parameters
:EMP_TBL.JOBCODE,
:EMP_TBL.SALARY INDICATOR :IND_1);
EXEC SQL
INSERT INTO =EMPLOYEE
VALUES (:EMP_TBL.EMPNUM, :EMP_TBL.FIRST-NAME,
:EMP_TBL.LAST_NAME, :EMP_TBL.DEPTNUM,
:EMP_TBL.JOBCODE,
:EMP_TBL.SALARY INDICATOR :IND_1);
You can also set the column to the null value using the NULL keyword.
The code to do this is:
EXEC SQL
INSERT INTO =EMPLOYEE
VALUES (:EMPNUM, :FIRST_NAME, :LAST_NAME,
:DEPTNUM, :JOBCODE, NULL);
Parameters
A parameter is a place holder variable in a dynamic SQL statement that allows you to
specify run-time input. You compile the SQL statement without the input values and
then supply the values when the statement is executed.
The syntax for using a parameter is:
identifier
is the name of the parameter.
indicator-parameter
is an indicator parameter name. The indicator parameter has the same format as the
parameter with which it is associated. See Using Indicator Parameters on page 2-13.
For a complete description of the parameter syntax elements, see the SQL/MP
Reference Manual.
?[ identifier] [ [ INDICATOR ] ?[ indicator-parameter] ]
[ TYPE AS {DATETIME [ start-date-time TO] end-date-time} ]
[ { } ]
[ {DATE } ]
[ { } ]
[ {TIME } ]
[ { } ]
[ {TIMESTAMP } ]
[ { } ]
[ {INTERVAL start-date-time } ]
[ { [ ( start-field-precision ) ] } ]
[ { [ TO end-date-time ] } ]