Database Reference
In-Depth Information
12.1 Insertion of Data
There are three general formats of the Insert statement; the abridged form of the syntax
for each format is provided in Figure 12-1 :
Note:
1.
The first format is used when the attribute values to be
inserted are explicitly provided with the statement (typically
by an SQL user).
2.
The second format is used when the attribute values to be
inserted are implicitly provided from program variables
(useful in embedded SQL). Oracle's host language is PL/SQL
(a Pascal-like language). The optional ampersand (&) that
precedes the program variable denotes an execution time
variable; the user will be prompted to specify a value when
the SQL statement is executed. If no ampersand precedes
the variable, then the SQL statement must appear as an
embedded SQL statement within a PL/SQL program block;
the values for the insertion are obtained from the specified
program variables; some languages (for example C++) require
a colon (:) to precede source program variables.
3.
The third format is used when tuples to be inserted are to
come from the result of some query.
4.
If all the column names are omitted, this is equivalent to
specifying them all in the same order as they were specified in
the Create-Table statement.
Figure 12-1. Abridged Form of the Insert Statement
 
Search WWH ::




Custom Search