Prepare for your Next Interview
This is a discussion on Ref cursors, Packages within the Oracle forums, part of the Databases category; Hi friends, i need help regarding ref cursors. What is the main use of Ref cursors? How to use ref cursors? How to execute ref cursors? is ref cursors create ...
|
|||
|
Hi friends, i need help regarding ref cursors.
What is the main use of Ref cursors? How to use ref cursors? How to execute ref cursors? is ref cursors create along with procedures and functions or packages? am preparing for interview. please help me in this regard. so that am greatful to u. |
| Sponsored Links |
|
|||
|
Re: Ref cursors, Packages
>>What is the main use of Ref cursors?
A ref cursor is basically a data type. A variable created based upon that datatype is called a cursor variable. A cursor variable can be assosiated with different queries at run time. The main advantages are 1. Ref cursors are dynamic in nature. Its contents can be changed dynamically depending upon the requirement. 2. A Ref cursor can be passed as parameters to sub programes. 3. A Ref cursor can be returned to a client. >>is ref cursors create along with procedures and functions or packages? A ref cursor can be used in procedures, functions and packages. For examples follow the links How to use the oracle REF CURSOR Oracle Ref Cursors |
|
|||
|
Re: Ref cursors, Packages
Ref cursor is noting but a dynamic cursor. There is no need to declare the in the declaration block. We can call it directly where we need in procedure or package or function.
|
|
|||
|
Re: Ref cursors, Packages
>>There is no need to declare the in the declaration block.
How can you use a cursor variable of type REF cursor without declaring it? It is must. type c1 is ref cursor; empvar c1; But in declaration block you need not associate a query with cursor variable. You can dynamically do it at run time. |
|
|||
|
Re: Ref cursors, Packages
Quote:
Thank you very much sir. it is very useful information for me. |
|
|||
|
Re: Ref cursors, Packages
what is ref cursors? ref cursor mean to reference cursor, that is call pointer. This pointer is reference to the cursor variable. This cursors known as ref cursor. Basically ref cursors are devided into 2 categories. 1. Strong cursor 2. Week cursor strong cursor means whose return type is specified week cursor means whose return type is not specified the syntax for a ref_cursor type is: type ref_cursor_name is ref cursor [return record_type]; for strong cursor: type type_name ref cursor return cursor_name%emp.empno; for week cursor: type type_name ref cursor;
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Parameters passing in packages in Interfaces | nishank31 | Oracle Apps | 2 | 10-15-2008 06:20 AM |
| Cursors in PL/SQL | joel | Oracle | 4 | 07-21-2008 04:05 PM |
| Cursors in packages | babi_geek | Oracle | 5 | 06-13-2008 02:39 AM |
| info on pay packages | simar_3391 | Companies | 4 | 08-04-2007 11:23 AM |
| How is SAP different from other ERP packages? | Geek_Guest | SAP R/3 | 0 | 07-07-2007 10:40 AM |