GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Tech FAQs  >  PL/SQL

 Print  |  
Question:  Difference between a cursor and reference cursor



August 08, 2006 01:00:43 #8
 Gupta   Member Since: Visitor    Total Comments: N/A 

RE: Difference between a cursor and reference cursor
 

Hi

Cursor (explicit cursor) are static cursors which can be associated with onlyone SQl statement at the same timeand this statement is known when block is compiled. A Cursor Variable,  on the other hand, can be associated with different queries at runtime.

Static Cursor are analogus to PL/SQL constants because they can only be associated with one runtime query, whereas reference cursor are analogus to PL/SQL variables, which can hold different values at runtime.

Reference Cursor  can have return type.

Beacause of reference type,  no storage is allocated for it when it is declared. Before it can be used, it needs to point to a valid area of memory, which can be created either by allocating it to the client-side program or on the server by PL/SQL engine.

     

 

Back To Question