Passing cursor parameters, PL-SQL Programming

Passing Cursor Parameters

You use the OPEN statement to pass the parameters to a cursor. Unless you want to accept the default values, each proper parameter in the cursor declaration should have a parallel actual parameter in the OPEN statement. For illustration, given is the cursor declaration

DECLARE

emp_name emp.ename%TYPE;

salary emp.sal%TYPE;

CURSOR c1 (name VARCHAR2, salary NUMBER) IS SELECT ...

any of the statements below opens the cursor:

OPEN c1(emp_name, 3000);

OPEN c1('ATTLEY', 1500);

OPEN c1(emp_name, salary);

In the last illustration, if the identifier salary is used in the cursor declaration, it refers to the proper parameter. But, if it is used in the OPEN statement, it refers to the PL/SQL variable. To keep away from the uncertainty, use the exclusive identifiers.

The Formal parameters declared with a default value need not have a parallel actual parameter. They can simply suppose their default values when the OPEN statement is executed.

Posted Date: 10/4/2012 3:53:08 AM | Location : United States







Related Discussions:- Passing cursor parameters, Assignment Help, Ask Question on Passing cursor parameters, Get Answer, Expert's Help, Passing cursor parameters Discussions

Write discussion on Passing cursor parameters
Your posts are moderated
Related Questions
PL SQL Code Review HEADER ELEMENTS File Name Clear, meaningful and descriptive about main objective of the file. Multiple words are joined using underscores which adh

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

Fetching from a Cursor Variable The FETCH statement retrieve rows one at a time from the product set of a multi-row query. The syntax for the same is as shown: FETCH {curso

DBMS_OUTPUT: The Package DBMS_OUTPUT enables you to display output from the PL/SQL subprograms and blocks, that makes it easier to test and debug them. The procedure put_ line

Effects of NULL in Table Literal When a VALUES expression appears as the source value for an SQL INSERT statement, the key word NULL can appear as a field value, such that for

Albeit simple method : These all the truth tables give us our first as albeit simple method for proving a theorem: where check whether it can be written in propositional logic

Effects of NULL for UNIQUE Specification When a UNIQUE specification u for base table t includes a column c that is not subject to a NOT NULL constraint, the appearance of sev

I want to implement heap sort algorithm in pl sql please share the source code for guidance

Need for Dynamic SQL: You need dynamic SQL in the situations as follows: 1) You would like to execute a SQL data definition statement (like CREATE), a data control statemen

Predefined Exceptions The internal exception is raised implicitly whenever your PL/SQL program exceeds a system-dependent limit or violates an Oracle rule. Each & every Oracle