Discussion Locked

oracle pl/sql

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

would be appreciated if some body post the easiest and simpliest way to understanding pl/sql blocks and cursors. (oracle 8i)

thanks

2 replies

by daphne_isb

Shortly,

basicly 3 type of block :anonymous, named procedure and function blocks...
1)anonymous can be called at trigger or application events..and very general
2)procedure block performs some actions
3) functions returns a value

these are the parts of pl/sql blocks :
Declare: you declare constants , variables etc.. here
Begin :Mandatory part of block..statments,loops are follow this part
Exception :an identifier for error codes or error messages.(Optional part)
End : Mandatory word ..it ends the block...

Cursors : are the memory area that Database server reserve
for SQL command , PL/SQL opens Implicit cursor...
Implicit cursor can be checked by :
%ROWCOUNT
%FOUND
%ISOPEN
%NOTFOUND

If your select returns one or many rows then explicit cursor is opened
you declare explicit cursor at "declare" part
then "Open" the cursor and "Fetch" reads records into defined variables
finally, you terminates with "close"

If you get into details for PL/SQL..
you can visitthese site :
http://download-west.oracle.com/otndoc/oracle9i/901_doc/appdev.901/a89856/toc.htm

I hope this give you an idea ...

Regards,

This discussion is closed to new replies.