Go4Oracle

Member Login






Powered by CodeRevolts
You are here  :Home arrow Articles arrow PL/SQL arrow Basic Cursor Writing
Basic Cursor Writing E-mail
(1 vote)
Written by Amal   
Monday, 27 October 2008
 

Views : 255    


Basic Cursors In PLSQL

A cursor is a memory area allocated to work with select statements and is declared by a name.

Need For Cursor
In any PLSQL Statement which is IMPLICIT you may or maynot use a cursor but if the Statement is Explicit the use of cursor in a plsql programs becomes mandatory

Basic operations while working with a cursor.

1. Declare a cursor.

Declaration of a cursor is always in the declare section of the PLSQL block. Basically it is of following format.
Declare
Cursor cursor_name is Select .. , .... , ... from Table_Name;

The above declaration creates a Cursor;

2. Open Cursor.

This is another operation that one has to work with. All cursors that are declared has to be opened to execute the select statement which is stored in the Cursor Area. Same cursor cannot be opened twice in a Plsql Statment

3. Fetch. Cursor  This operation is for fetching the records into a declared variable. Please notes in a basic plsql bloch where a cursor is declared with a select statement the total number of select statement should match with the fetch variable.

Eg cursor has a select statement like ..Select col1,col2,col3 from table.
In the the fetch operation with be fetch cursor into a,b,c (these have to be declared in the declare section.) col1 is fetch in a,col2 is fetch into b and col3 is fetched into c. where a,b,c are 3 declared variables.

4. Close Cursor. : the is the close the cursor and release the allocated memory area. Whenever a PLSQL programs is complete after successfull completion or terminates due do some error the cursor is alway closed by itself.

Some other topics that one should be aware of while working with cursors are
Cursor Attributes
Exception Handling
Different types of Cursors.
Parameter Passing In Cursors.

 

 

If you want any more information related to cursors You can Post it on FORM here 





Reddit!Del.icio.us!Google!Live!Facebook!Slashdot!Netscape!Technorati!StumbleUpon!Newsvine!Furl!Yahoo!Smarking!Ma.gnolia!Free social bookmarking plugins and extensions for Joomla! websites! title=

   

Users' Comments  
 

Average user rating

   (0 vote)

 

Display 1 of 1 comments

hXgqykPgXXH

By: ClarkKent (Guest) on 20-11-2008 19:43

hXgqykPgXXH

By: ClarkKent (Guest ) on 20-11-2008 19:43

Extraordinarity: , bitches have sex huge penises, bitches have sex huge penises, http:// ladies.yourmoviessex.com/ bitches-have-sex-huge- penises.html bitches have sex huge penises, biggest buns wives, biggest buns wives, http:// ladies.yourmoviessex.com/ biggest-buns-wives.html biggest buns wives, biggest breasted women, biggest breasted women, http:// ladies.yourmoviessex.com/huge- labia-insertions.html biggest breasted women, huge toons breasts, huge toons breasts, http:// ladies.yourmoviessex.com/huge- toons-breasts.html huge toons breasts, hugest mammillaed adolescents, hugest mammillaed adolescents, http:// ladies.yourmoviessex.com/ hugest-mammillaed- adolescents.html hugest mammillaed adolescents,

 

Display 1 of 1 comments



Add your comment
Name
E-mail
Title  
 
Comment
 
Available characters: 600
   Notify me of follow-up comments
  Mathguard security question:
KBE         YUT      
Q      2      7   DDY
QTF   T8G   OXN      
  T    K    Q     XHN
8KH         RXD      
   
   

< Prev   Next >
Register Now

Bookmark Us

 
 

Who's Online

No Users Online

Advertisement

Linux Indore - 2007

Hello, you either have JavaScript turned off or an old version of Macromedia's Flash Player. Get the latest flash player.

Most Commented Items

Basic Cursor Writing
(1 comment)
Files that control oracle inst
(1 comment)
ROWID OF A RECORD (PSUEDO COLU
(1 comment)
rownum a pseudocolumn
(1 comment)

Visitors Counter

mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter
mod_vvisit_counterToday52
mod_vvisit_counterYesterday104
mod_vvisit_counterThis week156
mod_vvisit_counterThis month519
mod_vvisit_counterAll22673

Our Recommendations

Get Firefox browser!
Go to Google!Get a free mail account!Get The Gimp!Get Openoffice!Get Videolan!