Database Reference
In-Depth Information
Figure 24.9
An Implicit Cursor
FOR Loop.
Now let's describe some small facts about changing data from within
PL/SQL blocks.
24.5
Changing Data in PL/SQL
Not only can data in tables be changed from within PL/SQL blocks, but
there are some small additions making coding a little easier and more effi-
cient. One of these additions is the RETURNING INTO clause, as shown
in the combined syntax for INSERT, UPDATE, and DELETE commands
in Figure 24.10.
In general. the RETURNING INTO clause can be used to return
expressions used in DML statements back into variables in the calling PL/
SQL block. These variables can be used by subsequent commands in the
PL/SQL block. In the code snippet shown as follows, the first INSERT
command effectively passes the ARTIST_ID directly to the second
INSERT command. Without the RETURNING INTO clause, the
ARTIST_ID value would have to be retrieved using a SELECT command
between the two INSERT commands.
 
Search WWH ::




Custom Search