Rules for INSERT … SELECT in Embedded SQL and Stored Procedures
The following rules apply to using the selected form of INSERT with embedded SQL and
stored procedures:
The number of rows in the temporary table returned by subquery determines the number of rows to be inserted.
If an error occurs after one or more of the selected rows has been inserted, then
the value ‑1002 is returned to SQLCODE and the current transaction is terminated with
rollback.
If subquery selects no rows, then the value +100 is returned to SQLCODE and no rows are inserted.