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
Second Step at defining type SID in SQL CREATE TYPE SID AS VARCHAR(5) ; Explanation: TYPE SID announces that a type named SID is being defined to the system.

Parameter Modes   To define the behavior of formal parameters you use the parameter modes. The 3 parameter modes, IN, OUT, & IN OUT, can be used with any subprogram. Though, a

Adding Table Constraints ALTER TABLE ENROLMENT ADD CONSTRAINT NameNotNull CHECK (Name IS NOT NULL) ; ALTER TABLE ENROLMENT ADD CONSTRAINT PK_StudentId_CourseId PRIM

I need to write one function and one procedure to query a Oracle 10.1 DB using PL SQL. I have the schema and exact queries...along with work Ive started and a template to put the a

Logical Connectives - SQL SQL's extended truth tables in which the symbol, for unknown, appears along with the usual T and F. Negation (NOT, ¬) Conjunction (

Data Types in SQL - Decimal DECIMAL, NUMERIC, REAL, FLOAT and various other terms for various sets of rational numbers. When these key words are specified for the declared typ

Question: (a) In the context of database security explain how the following database features help to enforce security in the database system: (i) Authorisation (ii) Access

Parameter & Keyword Description: function_name: The user-defined function is identifying by that keyword. parameter_name: This identifies the formal parameter that

Manipulating Objects: You can use an object type in the CREATE TABLE statement to indicate the datatype of a column. When the table is created once, you can use the SQL statem

Methods: In normal, a method is a subprogram declared in an object type specification using the keyword MEMBER or STATIC. The method cannot have similar name as the object typ