09.01.2015 Views

PL/SQL User's Guide and Reference

PL/SQL User's Guide and Reference

PL/SQL User's Guide and Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

INSERT Statement<br />

returning_clause<br />

This clause lets you return values from inserted rows, thereby eliminating the need<br />

to SELECT the rows afterward. You can retrieve the column values into variables<br />

<strong>and</strong>/or host variables, or into collections <strong>and</strong>/or host arrays. However, you cannot<br />

use the RETURNING clause for remote or parallel inserts. For the syntax of<br />

returning_clause, see "DELETE Statement" on page 13-58.<br />

sql_expression<br />

This is any expression valid in <strong>SQL</strong>. For more information, see Oracle9i <strong>SQL</strong><br />

<strong>Reference</strong>.<br />

subquery<br />

This is a SELECT statement that provides a set of rows for processing. Its syntax is<br />

like that of select_into_statement without the INTO clause. See "SELECT<br />

INTO Statement" on page 13-166.<br />

subquery3<br />

This is a SELECT statement that returns a value or set of values. As many rows are<br />

added to the table as are returned by the subquery. It must return a value for every<br />

column in the column list or for every column in the table if there is no column list.<br />

table_reference<br />

This identifies a table or view that must be accessible when you execute the INSERT<br />

statement, <strong>and</strong> for which you must have INSERT privileges. For the syntax of<br />

table_reference, see "DELETE Statement" on page 13-58.<br />

TABLE (subquery2)<br />

The oper<strong>and</strong> of TABLE is a SELECT statement that returns a single column value,<br />

which must be a nested table. Operator TABLE informs Oracle that the value is a<br />

collection, not a scalar value.<br />

VALUES (...)<br />

This clause assigns the values of expressions to corresponding columns in the<br />

column list. If there is no column list, the first value is inserted into the first column<br />

defined by the CREATE TABLE statement, the second value is inserted into the<br />

second column, <strong>and</strong> so on. There must be only one value for each column in the<br />

column list. Also, the datatypes of the values being inserted must be compatible<br />

with the datatypes of corresponding columns in the column list.<br />

<strong>PL</strong>/<strong>SQL</strong> Language Elements 13-105

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!