Embedded Usage
Host language variables can be used within expressions in the values clause or in the search condition of the subselect. Variables used in search conditions must denote constant values, and cannot represent names of database columns or include any operators. A host string variable can also replace the complete search condition of the subselect, as when it is used in the forms system query mode. Host language variables that correspond to column expressions can include null indicator variables.
The keyword REPEATED directs the Enterprise Access product or server to encode the insert and save its execution plan when it is first executed. This encoding can improve the performance of subsequent executions of the same insert.
Do not specify the REPEATED option for INSERT statement that is constructed using dynamic OpenSQL. A dynamic WHERE clause cannot be used in a repeated insert: the query plan is saved when the query is first executed, and subsequent changes to the WHERE clause are ignored.
The VALUES clause can include structure variables that substitute for some or all of the expressions. The structure is expanded by the preprocessor into the names of its individual members. Therefore, placing a structure name in the VALUES clause is equivalent to enumerating all members of the structure in the order in which they were declared.
The sqlerrd(3) of the SQLCA indicates the number of rows inserted by the statement. If no rows are inserted (for example, if no rows satisfied the subselect search condition), then the sqlcode variable of the SQLCA is set to 100.
Last modified date: 08/14/2024