Cursor variables in pl sql, PL-SQL Programming

Assignment Help:

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.

 


Related Discussions:- Cursor variables in pl sql

Keyword & parameter description - expressions, Keyword & Parameter Descript...

Keyword & Parameter Description: boolean_expression: This is an expression which yields the Boolean value that is TRUE, FALSE, & NULL. character_expression: This

Using delete - collection method, Using DELETE This process has three ...

Using DELETE This process has three forms. The DELETE removes all elements from the collection. DELETE(n) removes the nth element from the nested table. When n is null, then D

Write a program, to write a heap sort program usin pl-sql

to write a heap sort program usin pl-sql

%notfound - implicit cursor attributes, %NOTFOUND The %NOTFOUND is the...

%NOTFOUND The %NOTFOUND is the logical opposite of the %FOUND. The %NOTFOUND yields TRUE when an INSERT, UPDATE, or DELETE statement affected no rows, or the SELECT INTO state

Example of using aggregation on nested tables, Example of Using Aggregation...

Example of Using Aggregation on Nested Tables Example: How many students sat each exam WITH C_ER AS (SELECT CourseId, CAST (TABLE (SELECT DISTINCT StudentId, Mark FROM EXAM

Miller-urey''s experimental procedure, MILLER-UREY' S EXPERIMENTAL PROCEDU...

MILLER-UREY' S EXPERIMENTAL PROCEDURES - They recreated the probable conditions on the primitive earth in the laboratory. An atmosphere containing hydrogen, ammonia, me

Character types, ROWID and UROWID Internally, every database table has ...

ROWID and UROWID Internally, every database table has a ROWID pseudo column that stores binary values known as rowids. Each rowid shows the storage address of a row. A physical

Naming conventions-pl/sql, Naming Conventions The similar naming conventi...

Naming Conventions The similar naming conventions apply to all PL/SQL program items and units including the variables, cursors, constants, cursor variables, procedures, exception

Initializing records, Initializing Records The illustration below show...

Initializing Records The illustration below shows that you can initialize a record in its type definition. Whenever you declare a record of the type TimeRec, its 3 fields supp

Exception handling, set serveroutput on declare a number(5); b n...

set serveroutput on declare a number(5); b number(5); c number(5); begin a:=&a; b:=&b; c:=a/b; dbms_output.put_line(c); exception when zero_d

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd