Oracle Cursor types

What are the types of cursors apart from explicit and implicit cursors ? Explain when and where they are used ?

Showing Answers 1 - 6 of 6 Answers

Manoharan

  • Oct 25th, 2007
 

1. Implicit Cursor
2. Explicit Cursor
3. Ref Cursor

Implicit Cursor like SQL%rowcount,SQL%rowtype...

Explicit   cursors are user defined cursor

Ref Cursor is object name of the cursor type. Its mainly used for dynamic purpose

There are only two types of cursors in oracle Pl/sql.

1. Implicit cursors
2. Explicit cursors
    We can define an explicit cursor as static or dynamic (REF CURSOR).

    The difference between these two is
   1. A cursor is once define its contents are fixed and can't be changed.
    Using ref cursor we can create a dynamic cursor. In dynamic cursors the contents of cursor can be changed dynamically depending upon the sitution.
   2. A cursor can't be passed as parameter from subroutine to subroutine. Where as ref cursor can be passed as paramer to subprograms.
   3. A ref cursor can be returned to the client machine. A cursor can't.
   4. A cusor can be defined globally. A ref cursor can't

  Generally we use ref cursor when we need to return  result set. In other cases it is advisable to use static cursor because they give better performace.



    
  

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions