General Rules for INSERT 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

General Rules for INSERT in Embedded SQL and Stored Procedures

The following rules apply to both forms of INSERT in embedded SQL and stored procedures:

  • The row to be inserted is constructed by building a candidate row as follows:
  • a Define each column value of the row to be NULL.

    b Assign each inserted value to the corresponding column.

     

    IF the result row has this value for any NOT NULL column …

    THEN the insertion …

    any non-null

    succeeds.

    a null

    fails.

    SQLCODE is set to -1002.

  • Insert values are set in the corresponding row column values according to the rules for defining host variables.
  • If the table identified by table_name is a view that was defined WITH CHECK OPTION, then the row to be inserted must be in the set of rows selected by the view.