Inserting updating records using pl sql cursor
Sometimes we might want to print the value of a PL/SQL local variable.A ``quick-and-dirty'' way is to store it as the sole tuple of some relation and after the PL/SQL statement print the relation with a This document was written originally by Yu-May Chang and Jeff Ullman for CS145, Autumn 1997; revised by Jun Yang for Prof.
This clause can also be extended to lock only the intended table in the SELECT query containing more than one table in joins using the FOR UPDATE OF clause.
The simplest form of program has some declarations followed by an executable section consisting of one or more of the SQL statements with which we are familiar.
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.
After a TCL operation is performed, the cursor pointer gets reset and the cursor will be no longer accessible, thus results in an error when fetched further as shown below.
Thus, any TCL operation on the cursor record set has to be done only after fetching all the rows from the cursor context area using a loop process similar to the above listing example.
If you don't see what is wrong immediately, try issuing the command ) to see the most recent compilation error.