is used to specify that the column specified by ext_id_column is used to look up the rowid to be inserted into the column specified by column_name.
schema_name
is the name of the schema of the table that contains the foreign key column being specified as the external ID column.
table_name
is the name of the table that contains the foreign key column being specified as the external ID column.
ext_id_column
is the external ID column.
Example A
This example uses a list of expressions to insert records. Each Insert statement adds one record to the table. In this case, one record is added to the table emp. Values are specified for five columns. The remaining columns in the table are assigned the default value or NULL if no default value is specified.
This example uses a Select statement to insert records. The number of columns in the result of the Select statement must match exactly the number of columns in the table if no column list is specified, or it must match the number of column names specified in the column list. A new entry is created in the table for every row of the Select result.
INSERT INTO emp1 (first_name,
last_name,
emp_id,
dept,
salary)
SELECT first_name, last_name, emp_id, dept, salary FROM emp
WHERE dept = 'D050'
Example C
This example uses a list of expressions to insert records and specifies an external ID column (a foreign key column) named accountId that references a table that has an external ID column named AccountNum.