What is the difference between PL SQL cursor and PL SQL ref cursor?
What is the difference between PL SQL cursor and PL SQL ref cursor?
A cursor is really any SQL statement that runs DML (select, insert, update, delete) on your database. A ref cursor is a pointer to a result set. This is normally used to open a query on the database server, then leave it up to the client to fetch the result it needs.
What is meant by ref cursor?
A ref cursor is a variable, defined as a cursor type, which will point to, or reference a cursor result. The advantage that a ref cursor has over a plain cursor is that is can be passed as a variable to a procedure or a function.
What does a REF CURSOR do in Oracle?
Introduction to REF CURSORs. Using REF CURSORs is one of the most powerful, flexible, and scalable ways to return query results from an Oracle Database to a client application. A REF CURSOR is a PL/SQL data type whose value is the memory address of a query work area on the database.
Can you have a specification without a REF CURSOR?
While it is possible to have a specification without a body, as when declaring a set of public constants, it is not possible to have a body with no specification. Using REF CURSOR s is one of the most powerful, flexible, and scalable ways to return query results from an Oracle Database to a client application.
Can a REF CURSOR point to a random record?
You cannot position a record pointer inside the REF CURSOR to point to random records in the result set. A REF CURSOR is a PL/SQL data type. You create and return a REF CURSOR inside a PL/SQL code block. This section demonstrates how to create a PL/SQL stored procedure. To create a stored procedure:
Which is an example of a weak typed REF CURSOR?
And here is an example of a weak typed REF CURSOR declaration that is not associated with any specific structure: Starting from Oracle 9i, you can use SYS_REFCURSOR, which is a predefined weak typed REF CURSOR, to declare a weak REF CURSOR as follows: