ALLBASE/SQL Reference Manual (36216-90216)

452 Chapter11
SQL Statements E - R
INSERT
assigned in the INSERT statement, or by the default value of the column if it is not
included in the INSERT statement.
When a rule is fired by this statement, the rule's procedure is invoked after the changes
have been made to the database for that row and all previous rows. The rule's
procedure, and any chained rules, will thus see the state of the database with the
current partial execution of the statement.
If an error occurs during processing of any rule considered during execution of this
statement (including execution of any procedure invoked due to a rule firing), the
statement and any procedures invoked by any rules will have no effect. Nothing will
have been altered in the DBEnvironment as a result of this statement or the rules it
fired. Error messages are returned in the normal way.
The BULK option is not allowed within a procedure.
SQL Syntax — DynamicParameterValues
The following syntax applies to single row and bulk inserts that use
dynamic parameter substitution.
(? [,...])
Parameters — DynamicParameterValues
(? [,...]) represents one or more host variables in a prepared INSERT statement.
Each ? corresponds in sequential order to a column in the column name
list of the prepared statement (even when BULK is used).
When you use a data structure of sqlda_type to pass dynamic parameter
information between the application and ALLBASE/SQL, the number of
"?"s specified must match the sqld field of the descriptor area and the
number of values in a single element of the data buffer.
When you use host variables to pass dynamic parameter data values
between the application and ALLBASE/SQL, the number of "?"s specified
must match the number and order of the host variables in the related
EXECUTE statement. This does not apply when you use the BULK option as
you cannot mix host variables and dynamic parameters.
Description — Insert Rows with DynamicParameterValues
Statements using question marks (?) indicating dynamic parameters can be intermixed
with items in
SingleRowValues
and they can return either a value or a format. When
using dynamic parameters for values, the dynamic parameter becomes the data type of
the column. When using dynamic parameters for conversion functions, they become the
data type to which they are assigned (CHAR 72). Only TO_DATE, TO_TIME,
TO_DATETIME, and TO_INTERVAL are allowed here; TO_CHAR and TO_INTEGER
are not allowed.
When using the BULK option, statements using question marks (?), indicating dynamic
parameters, can contain only question marks (and no host variables) to indicate column