Oracle updating cursor loop
Here is an example: CREATE TABLE T1( e INTEGER, f INTEGER ); DELETE FROM T1; INSERT INTO T1 VALUES(1, 3); INSERT INTO T1 VALUES(2, 4); /* Above is plain SQL; below is the PL/SQL program.
The major nuance is that the form of the statement in PL/SQL only works if the result of the query contains a single tuple.
The situation is essentially the same as that of the "single-row select" discussed in Section 7.1.5 of the text, in connection with embedded SQL.
*/ EXCEPTION /* Exception handling section: error handling statements go here. The executable section also contains constructs such as assignments, branches, loops, procedure calls, and triggers, which are all described below (except triggers). C style comments ( or by putting the code in a file and invoking the file in the various ways we learned in Getting Started With Oracle.
Information is transmitted between a PL/SQL program and the database through variables. In many cases, a PL/SQL variable will be used to manipulate data stored in a existing relation.