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
to write a heap sort program usin pl-sql

Pl/SQL Expressions The Expressions are constructed by using the operands and operators. An operand is a constant, literal, variable, or function call which contributes a value

ALTER TABLE bb_basketitem ADD CONSTRAINT bitems_qty_ck CHECK (quantity BEGIN INSERT INTO bb_basketitem VALUES (88,8,10.8,21,16,2,3); END; Brewbean’s wants to add a check

The SQL ‘CREATE TABLE' scripts for all the tables you have implemented. Note that your tables must correspond exactly to the ERD you have provided in 1. above, or you will lose ma

Constants and Variables:   You can declare the constants and variables in the declarative section of any PL/SQL subprogram, block, or package. The Declarations allot the stor

Hi there, I have the final part of a submission to do, it is a demonstration that takes place tomorrow. I do not have to use previous information, but i have resources that sho

Using PRIOR and NEXT The PRIOR(n) returns the index number that precede index n in a collection. The NEXT(n) returns the index number which succeed the index n. If n has no pr

Write a cursor to open an employee database and fetch the employee record whose age is greater than 45

Package Body: The package specification is implemented by the package body. That is, the package body has the definition of every cursor and the subprogram declared in the pac

Fetching with a Cursor The FETCH statements retrieve the rows in the result set one at a time. After each and every fetch, the cursor advance to the next row in the result set