Defining ref cursor types, PL-SQL Programming

Defining REF CURSOR Types

To make cursor variables, you take 2 steps. At first, you define a REF CURSOR type, and then declare the cursor variables of that type. You can define the REF CURSOR types in any PL/SQL subprogram, block, or package using the syntax as shown:

TYPE ref_type_name IS REF CURSOR RETURN return_type;

Where ref_type_name is a type specifier used in the subsequent declarations of the cursor variables and return_type should present a record or a row in a database table. In the illustration below, you specify a return type that presents a row in the database table dept:

DECLARE

TYPE DeptCurTyp IS REF CURSOR RETURN dept%ROWTYPE;

REF CURSOR types can be weak (nonrestrictive) or strong (restrictive). 

Posted Date: 10/4/2012 4:00:23 AM | Location : United States







Related Discussions:- Defining ref cursor types, Assignment Help, Ask Question on Defining ref cursor types, Get Answer, Expert's Help, Defining ref cursor types Discussions

Write discussion on Defining ref cursor types
Your posts are moderated
Related Questions
Question: a) Given the following relation: Location(loc_id, bldg_code, room, capacity) The underlined field is a primary key. (i) Write a PL/SQL program using the impl

Create a view named CustomerAddresses that shows the shipping and billing addresses for each customer in the MyGuitarShop database. This view should return these columns from the

Parameter and Keyword Description: package_name: This construct identifies the package. AUTHID Clause: This determine whether all the packaged subprograms impleme

Logical Operators The logical operators AND, NOT, and OR follow the tri-state logic shown in table below. The AND and OR are binary operators; NOT is a unary operator.

Usefulness of Data Type In SQL, as in most computer languages, a type can be used for constraining the values that are permitted to be used for some purpose. In particular, i

Inserting Objects: You can use the INSERT statement to add objects to an object table. In the illustration below, you insert a Person object into the object table persons:

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

Projection in SQL - correct version Student StudentId is enrolled on some course. SELECT DISTINCT StudentId FROM IS_ENROLLED_ON In more complicated examples it is someti

Table Represents an Extension - SQL It describes how each tuple in a relation represents a true instantiation of some predicate and each true instantiation is represented by s

Data Abstraction The Data abstraction extracts the important properties of data while ignoring the not necessary details. Once you design a data structure, you can fail to reme