Re: Ref cursors, Packages
[B]>>What is the main use of Ref cursors?[/B]
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.
[B]>>is ref cursors create along with procedures and functions or packages?[/B]
A ref cursor can be used in procedures, functions and packages.
For examples follow the links
[url=http://www.oradev.com/ref_cursor.jsp]How to use the oracle REF CURSOR[/url]
[url=http://www.psoug.org/reference/ref_cursors.html]Oracle Ref Cursors[/url]
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
[B]>>There is no need to declare the in the declaration block.[/B]
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
hi krishna garu,
Thank you very much sir.
it is very useful information to me.
Re: Ref cursors, Packages
hi krishna garu,
Thank you very much sir.
it is very useful information for me.
Re: Ref cursors, Packages
[QUOTE=krishnaindia2007;31939][B]>>There is no need to declare the in the declaration block.[/B]
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.[/QUOTE]
hi krishna garu,
Thank you very much sir.
it is very useful information for me.
Re: Ref cursors, Packages
[b]what is ref cursors?[/b] 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;