Why use cursor variables, PL-SQL Programming

Why Use Cursor Variables ?

Primarily, you use the cursor variables to pass the query result sets between the PL/SQL stored subprograms and different clients. Neither PL/SQL nor any of its clients owns a result set; they merely share a pointer to the query work region in which the result set is stored. For instance, Oracle Forms application, an OCI client, and Oracle server can all refer to the same work region.

A query work region remains accessible as long as any cursor variable points to it. Along with, you can pass the value of a cursor variable freely from one scope to other. For illustration, if you pass a host cursor variable to a PL/SQL block embedded in a Pro C program, the work region to which the cursor variable points remains accessible after the block done. If you comprise a PL/SQL engine on the client side, the calls from client to server force no restrictions. For illustration, you can declare a cursor variable on the client side, open & fetch from it on the server side then carry on to fetch from it back on the client side. You can also reduce the network traffic by having a PL/SQL block open (or close) some host cursor variables in a single round trip.

Posted Date: 10/4/2012 3:58:52 AM | Location : United States







Related Discussions:- Why use cursor variables, Assignment Help, Ask Question on Why use cursor variables, Get Answer, Expert's Help, Why use cursor variables Discussions

Write discussion on Why use cursor variables
Your posts are moderated
Related Questions
SQL outer join SELECT * FROM IS_CALLED NATURAL LEFT JOIN IS_ENROLLED_ON Note that adding LEFT to an invocation of CROSS JOIN has no effect unless the right-hand operand

Nested Tables versus Index-by Tables The Index-by tables and nested tables are just similar. For e.g.  They have similar structure and their individual elements are accessed in

LEVEL You use the LEVEL with the SELECT CONNECT BY statement to categorize rows from a database table into a tree structure. The LEVEL returns the level number of a node in a

Using LOCK TABLE You use the LOCK TABLE statement to lock the whole database tables in the specified lock mode so that you can share or deny the access to them. For illustrati

Using SET TRANSACTION You use the SET TRANSACTION statement to begin the read-only or read-write transaction, start an isolation level, or assign your present transaction to a

%TYPE Attribute The %TYPE attribute gives the datatype of a record, field, nested table, database column, or the variable. You can use the %TYPE attribute as the datatype speci

Anatomy of a Command Figure, showing a simple SQL command, is almost identical to its counterpart in the theory book. The only difference arises from the fact that SQL uses a

Example of NOT EXISTS Operator - SQL Example is a translation into SQL of the corresponding example, which is included there merely to show that for any scalar comparison the

Creating a Table Syantax: CREATE TABLE ENROLMENT (StudentId SID, Name   VARCHAR (30) NOT NULL, CourseId CID, PRIMARY KEY (StudentId, CourseId)) ; Explan

Consider the schema for FreeChecking Bank, that we designed given below. Translate the given ER schema into SQL CREATE TABLE statements (indicating primary key, unique and foreign