passing cursor parametersyou use the open


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.

Request for Solution File

Ask an Expert for Answer!!
PL-SQL Programming: passing cursor parametersyou use the open
Reference No:- TGS0172693

Expected delivery within 24 Hours