Rules for INSERT … SELECT in Embedded SQL and Stored Procedures - Teradata Database

SQL Data Manipulation Language

Product
Teradata Database
Release Number
15.10
Language
English (United States)
Last Update
2018-10-06
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata® Database

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.