Execute Routine Clause

You can specify the EXECUTE FUNCTION statement (or the EXECUTE PROCEDURE statement) to insert values that a user-defined function returns

.
(1)
Execute Routine Clause

1  EXECUTE
1  PROCEDURE procedure
1  FUNCTION function
2  (?  + , %Argument1 )
Notes:
Element Description Restrictions Syntax
function, procedure User-defined function or procedure to insert the data Must exist Database Object Name
When you use a user-defined function to insert column values, the return values of the function must have a one-to-one correspondence with the listed columns. That is, each return value
  • must be of a data type the same or compatible with the corresponding column,
  • and its order among return values must match the column's order in the column list.

For backward compatibility, HCL OneDB™ can use the EXECUTE PROCEDURE keywords to execute an SPL function that was created with the CREATE PROCEDURE statement.

If the called SPL routine scans or updates the target table of the INSERT statement, the database returns an error. That is, the SPL routine cannot select data from the table into which you are inserting rows.

If a called SPL routine contains certain SQL statements, the database server returns an error. For information on which SQL statements cannot be used in an SPL routine that is called within a data manipulation statement, see Restrictions on SPL Routines in Data-Manipulation Statements.