NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
P-12
Parameters
== Request that the $data3 sort process use $temp7 for
== scratch space.
CREATEINDEX INDEX \NEWYORK.$data3 SCRATCH ($TEMP7)
== End of Configuration File
Parameters
Parameters let you provide literals for prepared DML statements or command files when
you execute the statements or commands (using EXECUTE or OBEY) rather than when
you PREPARE or create them. You can use parameters for literals in DML statements
compiled with PREPARE or for literals in SQLCI command files.
Typically, you use parameters instead of literals so that you can PREPARE a statement
at one time and execute it later—possibly multiple times—substituting different values
for each execution with the USING clause of EXECUTE.
If you use named parameters, you can also use the TACL PARAM command or the
SQLCI SET PARAM command to assign values to the parameters before you issue an
EXECUTE (for a statement) or OBEY (for a command file). In this case, you can also
reuse the parameters in subsequent executions of the statement or command file without
resetting them.
The following diagram shows how to specify a parameter in a DML statement or SQLCI
command file. (See EXECUTE Statement
on page E-7 or SET PARAM Command on
page S-36 for information about assigning values to parameters.)
?[param-name] [ [ INDICATOR ] ?[indicator-param] ]
[TYPE AS {DATETIME [start-dt TO] end-dt }]
[ {DATE }]
[ {TIME }]
[ {TIMESTAMP }]
[ {INTERVAL start-dt }]
[ { [ (start-field-precision) ] }]
[ { [ TO end-dt ] }]
start-dt and end-dt are:
{ YEAR }
{ MONTH }
{ DAY }
{ HOUR }
{ MINUTE }
{ SECOND }
{ FRACTION [ (precision) ] }
Only end-dt can include the precision option for the
FRACTION field.