Cursor variables in pl sql, PL-SQL Programming

Cursor Variables:

 To execute the multi-row query, the Oracle opens an unnamed work region that stores the processing information. You can use an explicit cursor that names the work region, to access the information. Or, you can use the cursor variable that points to the work region. While a cursor always refers to similar query work region, a cursor variable can refer to various work regions. To create the cursor variables, you can define a REF CURSOR type, and then declare the cursor variables of that type.

The Cursor variables are such as C or Pascal pointers that hold the memory location (address) of a little item rather of the item itself. Therefore, declaring a cursor variable build a pointer, not an item.

1597_constant variable.png

Keyword and Parameter Description:

type_name:

This is a user-defined type specifier that is used in the subsequent declarations of the PL/SQL cursor variables.

REF CURSOR:

In PL/SQL, the pointers have datatype REF X, where REF is short form of REFERENCE and

X stands for the class of objects. And hence, the cursor variables have datatype REF CURSOR.

RETURN:

This keyword introduces the RETURN clause that specifies the datatype of the cursor variable result value. You can use the %ROWTYPE attribute in the RETURN clause to give a record type which presents a row in a database table or a row returned by a cursor or strongly typed cursor variable. You can also use the %TYPE attribute to give the datatype of a earlier declared record.

cursor_name:

These identify an explicit cursor earlier declared within the present scope.

cursor_variable_name:

These identify a PL/SQL cursor variable formerly declared within the present scope.

record_name:

These identify a user-defined record formerly declared within the present scope.

record_type_name:

These identify a RECORD type formerly defined within the present scope.

db_table_name:

These identify a database table (or view) that shuld be accessible when the declaration is elaborated.

%ROWTYPE:

These attributes provides a record type that presents a row in the database table or a row fetched from the cursor or strongly typed cursor variable. The Fields in the record and equivalent columns in the row have similar names and datatypes.

%TYPE:

These attributes provides the datatype of a formerly declared user-defined record.

 

Posted Date: 10/6/2012 9:14:45 AM | Location : United States







Related Discussions:- Cursor variables in pl sql, Assignment Help, Ask Question on Cursor variables in pl sql, Get Answer, Expert's Help, Cursor variables in pl sql Discussions

Write discussion on Cursor variables in pl sql
Your posts are moderated
Related Questions
Row Counterparts of Table Operators SQL does not have counterparts tuple rename, tuple projection, tuple extension, tuple join and tuple compose. To obtain the same effects as

Use Serially Reusable Packages To help you to manage the use of memory, the PL/SQL gives the pragma SERIALLY_ REUSABLE that mark some packages as serially reusable . So mark

Delimiters A delimiter is a simple or compound symbol which has a special meaning to PL/SQL. For example, you use delimiters to symbolize an arithmetic operation like additio

BIOCHE M ICA L ORIGIN OF LIFE - It is generally agreed by astronomers, geologists and biologists that the earth is approximately 4500-5000 million years old. It is an

THEO R Y OF SPECIAL CREATION - Life originated on the earth due to natural events by the super natural power. The biblical story of creation of world within six days was p

Datatype Conversion At times it is necessary to convert a value from one datatype to another. For e.g. if you want to inspect a rowid, you should convert it to a character stri

Oracle 10G new features:- Automatic Database Diagnostic Monitor System Advancements - these methods will provides several methods for extracting reports through the Automatic

Parameter and Keyword Description: select_item: This select_item is a value returned by the SELECT statement, and then assigned to the equivalent variable or field in the

Mutual Recursion The Subprograms are mutually recursive if they directly or indirectly call each other. In the illustration below, the Boolean functions odd & even, that dete

i NEED TO CREATE 3 guiS IN pl/sql sERVER PAGE FORM