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
Remote Operations: As the illustration shows below, the PL/SQL subprograms can execute the dynamic SQL statements which refer to the objects on a remote database: PROCEDURE

Product-specific Packages The Oracle and different Oracle tools are supplied with the product-specific packages which help you to build the PL/SQL-based applications. For illu

Nested Tables versus Index-by Tables The Index-by tables and nested tables are just similar. For e.g.  They have similar structure and their individual elements are accessed in

Use the NOCOPY Compiler Hint By default, the OUT and IN OUT parameters are passed by the value i.e. the value of an IN OUT actual parameter is copied into the corresponding fo

RETURN Statement The RETURN statement instantly completes the execution of a subprogram and returns control to the caller. The Execution then resumes with the statement below t

Product-specific Packages The Oracle and different Oracle tools are supplied with the product-specific packages which help you to build the PL/SQL-based applications. For illus

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

UNION without CORRESPONDING - SQL The use of UNION without CORRESPONDING. Example is merely by omitting CORRESPONDING, but only because the operands have identical SELECT clau

%ISOPEN The Oracle closes the SQL cursor automatically after executing its related SQL statement. As a result, the %ISOPEN forever yields FALSE.

Character Types The Character types allow you to store alphanumeric data, represent words and text, and manipulate the character strings. CHAR You use the CHAR dataty