2017  Kodetalk | Feedback | Privacy Policy | Terms | About

difference between cursor and ref cursor


What is the difference between cursor and ref cursor.How can these two are differentiated.


REF cursor is typically used to return record set or a cursor from stored procedure. REF Cursor is basically a data type. It is normally declared as type r_cursor is REF CURSOR; REF cursor supports dynamic change of query.

Normal cursor is a static cursor in which the query is assigned at design time and cant be changed at run time.

Normal cursors fall under the category of static cursors while REF cursors are dynamic. This means that normal cursors can only be used again not defined. Ref cursors on the other hand can be changed. A Ref cursor can be passed from one procedure to another. A normal cursor cannot.
Answer is