What are cursor?where are they used?
Answers were Sorted based on User's Feedback
Answer / sohini
Whenever you issue a SQL statement, the Oracle server opens
a SQL work area in memory in which the command is parsed
and executed. This area is called a cursor.There are two
type of cursors:
Implicit Cursor:PL/SQL declares a cursor implicitly for all
SQL data manipulation statements, including queries that
return only one row.PL/SQL manages this cursorautomatically.
Explicit Cursor:The programmer explicitly declares and
names an explicit cursor for queries that return more than
one row.it is managed by the programmer.
Explicit cursors are used when one wants to do some
processing with a set of rows fetched from a table or
multiple table.They are managed using OPEN,FETCH and CLOSE.
4 attributes are used in both types of cursors:%FOUND,%
NOTFOUND,%ROWCOUNT and %ISOPEN.
| Is This Answer Correct ? | 7 Yes | 1 No |
Answer / manvendra
USER DEFINED sql WORK AREA FOR QUERY IS CURSOR.
USED TO STORE RESULT SET PROVIDED BY THE QUERY FOR SHORT
AND TEMP BASIS.
MAIN STATES ARE
CLOSE
OPEN
FETCH
| Is This Answer Correct ? | 0 Yes | 1 No |
How to enter a new row into a table interactively?
How would you edit your CRONTAB to schedule the running of /test/test.sh to run every other day at 2PM?
State some uses of redo log files?
What spfile/init.ora file parameter exists to force the CBO to make the execution path of a given statement use an index, even if the index scan may appear to be calculated as more costly?
What are the different types of synonyms?
4. Using a set operator, display the creditor number of all creditors who have ever been paid.
What is the oracle implicit cursor?
how to join query for one source type is oracle another source type is sql server ?
How to find no of saturdays in a month using single sql ?
how to convert .db (extention) database file into .dmp (extention ) for oracle database ?
I just want to maintain data like an employee can belongs to 3 or more departments . We can resolve this by using composite key but it avoids normalization rules. So Can anyone tell me how can I maintain data.
What is difference between SQL and SQL*PLUS?