Results 1 to 8 of 8

Thread: Ref cursors, Packages

  1. #1
    Junior Member
    Join Date
    Jun 2008
    Answers
    6

    Unhappy Ref cursors, Packages

    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.


  2. #2
    Expert Member
    Join Date
    Sep 2007
    Answers
    697

    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


  3. #3
    Junior Member
    Join Date
    Jun 2008
    Answers
    1

    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.


  4. #4
    Expert Member
    Join Date
    Sep 2007
    Answers
    697

    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.


  5. #5
    Junior Member
    Join Date
    Jun 2008
    Answers
    6

    Re: Ref cursors, Packages

    hi krishna garu,
    Thank you very much sir.
    it is very useful information to me.


  6. #6
    Junior Member
    Join Date
    Jun 2008
    Answers
    6

    Re: Ref cursors, Packages

    hi krishna garu,
    Thank you very much sir.
    it is very useful information for me.


  7. #7
    Junior Member
    Join Date
    Jun 2008
    Answers
    6

    Re: Ref cursors, Packages

    Quote Originally Posted by krishnaindia2007 View Post
    >>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.
    hi krishna garu,
    Thank you very much sir.
    it is very useful information for me.


  8. #8
    Junior Member
    Join Date
    Jul 2008
    Answers
    1

    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;


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact