NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
E-9
Considerations—EXECUTE
COMPUTE_TIMESTAMP (date)—an SQLCI function that returns a Julian
timestamp for the date and time you specify in date as a value of data type
NUMERIC 18 or LARGEINT.
See CURRENT_TIMESTAMP Function
on page C-163 or
COMPUTE_TIMESTAMP Function on page C-57 for more detail about the
functions. For examples of their use with EXECUTE, see the examples later in this
entry.
:variable
(used in programs) is a host variable that contains a value for a parameter in the
statement.
:in-sqlda
(used in programs) is an SQLDA filled by DESCRIBE INPUT that points to values
for parameters in the statement.
RETURNING { :variable }
{ USING DESCRIPTOR :out-sqlda }
(used only if a dynamic INSERT RETURNING is executed) directs SQL to return
the SYSKEY for the last record inserted.
:variable is a host variable in which to return the key. It must be of an
appropriate type for the key (INTEGER UNSIGNED for tables with entry-
sequenced or relative organization; LARGEINT SIGNED for tables with key-
sequenced organization).
:out-sqlda is an SQLDA set by the DESCRIBE statement that tells where to
return the key. If you use this option, your program must have set the VAR_PTR
field in the SQLDA to point to a buffer to receive the SYSKEY value.
If you use the RETURNING clause for a table with a clustering key, SQL returns
only the appended SYSKEY. To find the record, specify the clustering key columns
and the SYSKEY column (the most efficient method), or only the SYSKEY column.
Considerations—EXECUTE
Scope of EXECUTE
A statement must be compiled by PREPARE before you can EXECUTE it but after
it is compiled, you can EXECUTE the statement multiple times without recompiling
it.
host language scoping rules apply to EXECUTE in programs. For more information,
see the NonStop SQL/MP programming manual for the host language you use.
Parameter values
You must supply a value for each formal parameter in the statement to be executed,
and each value must be of a type compatible with the associated formal parameter.