I know cursor variable is a pointer of type REF CURSOR.
But what about cursor. Whether a cursor is a pointer or variable?
Printable View
I know cursor variable is a pointer of type REF CURSOR.
But what about cursor. Whether a cursor is a pointer or variable?
A Cursor is always a pointer.
For every sql statement execution certain area in memory is allocated. This are is called private sql area or context area. Cursor acts as a pointer to this context area.
When you declare a cursor, you get a pointer variable, which does not point any thing. When the cursor is opened, memory is allocated and the cursor structure is created. The cursor variable now points the cursor. When the cursor is closed the memory allocated for the cursor is released.
The only difference between cursor and cursor variable is cursor is static in nature. Once a statement is assosiated with it we can't change its contents.
Where as a cursor variable can be assosiated with different queries at runtime depeding upon the requirement.
Cursor is a pointer .
cursor is handle for the memory assosiated with a specific statement.
cursor is requried to process rows for inducial queries return multiple rows.
this is 2 types
implicit
explicit
implict means private sql area.
explict we r select mutiple records
[B]>>implict means private sql area.[/B]
Implicit cursors use private sql area or context area to store its information.
[B]>>cursor is requried to process rows for inducial queries return multiple rows.[/B]
Can't we use a cursor to process a single row.
Every sql statement is a cursor.