P. 1
DBA Lesson

DBA Lesson


|Views: 405|Likes:
Published by blackwolf23

More info:

Published by: blackwolf23 on Sep 08, 2009
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less






When you are finished with the cursor it is always wise to close it, each cursor uses memory so closing
it allows Oracle to recover it.

Select for Update with Cursors.


When you issue a select statement in Oracle, no locks are placed on the database. However there will
be occasions that you will want to lock a set of records before changing then in you PL/SQL program.
This can be done using the FOR UPDATE clause of the SELECT statement.

declare c_customers is
select name,phone
from customers
for update;

The sample exam questions can be found here!

Do you have any questions?, feel free to ask them in the Oracle DBA users forum here.

Click here to return to the lesson index.

Go to lesson 10

Go to lesson 12


Lesson Twelve - Loops

In our twelfth lesson we will cover the following topics:

The simple loop
Numeric loops
The WHILE loop

The ability to loop is one of the main differences between SQL and PL/SQL so it is something that
must be well understood. The three loop constructs in PL/SQL are very simple and easy to understand.

Why three different loop constructs?, for flexibility that's why. After having made that statement I'll
now admit that I only ever use one because I'm lazy and I can do any loop I require using it.

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->