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

Sql scripts, The SQL ‘CREATE TABLE' scripts for all the tables you have imp...

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

Components of an object type - attributes in pl/sql, Attributes: Just ...

Attributes: Just similar to variable, an attribute is declared with a name and datatype. The name should be exclusive within the object type. The datatype can be any Oracle ty

Package dbms pipe in pl/sql, DBMS_PIPE: The Package DBMS_PIPE allows va...

DBMS_PIPE: The Package DBMS_PIPE allows various sessions to communicate over the named pipes. (A pipe is a region of memory used by one of the process to pass information to

Join and and in sql, JOIN and AND in SQL In this Section is all about ...

JOIN and AND in SQL In this Section is all about one operator, JOIN. SQL's closest counterpart, NATURAL JOIN, has already been covered. Here we look at several other "join" op

Cursor variables, What Are Cursor Variables  ? The Cursor variables ar...

What Are Cursor Variables  ? The Cursor variables are like C or Pascal pointers that hold the memory location (address) of some item rather of the item itself. Therefore, decl

I need data entry conversion project, Project Description: This is stage...

Project Description: This is stage 1 of a larger conversion project. We are converting a traditional Server/Client application written in Access 2007 into a web interface with S

Insert command in sql, INSERT Command in SQL Loosely speaking, INSERT...

INSERT Command in SQL Loosely speaking, INSERT takes the rows of a given source table and adds them to the specified target table, retaining all the existing rows in the targ

Object types and collections - performance of application, Use Object Types...

Use Object Types and Collections The Collection types and object types increase your efficiency by allowing for the realistic data modeling. The Complex real-world entities an

Some varray examples-manipulating collections, Some Varray Examples In S...

Some Varray Examples In SQL Plus, assume that you define an object type Project, as described below: SQL> CREATE TYPE Project AS OBJECT ( 2 project_no NUMBER(2), 3 title VARCHA

Number types in pl/sql, Number Types The Number types permit you to sto...

Number Types The Number types permit you to store the numeric data (real numbers, integers, and floating-point numbers), show quantities, and do computations. BINARY_INTEG

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