Passing cursor parameters, PL-SQL Programming

Assignment Help:

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.


Related Discussions:- Passing cursor parameters

Keyword and parameter description in pl sql, Keyword and Parameter Descript...

Keyword and Parameter Description: label_name: This is an undeclared identifier which optionally labels the PL/SQL block. When used, label_name should be enclosed by the do

%isopen - explicit cursor attributes, %ISOPEN The %ISOPEN yields TRUE ...

%ISOPEN The %ISOPEN yields TRUE if its cursor or cursor variable is open; or else, the %ISOPEN yields FALSE. In the illustration, you use the %ISOPEN to select an action:

3cx pbx sync windows service, 3CX PBX sync Windows Service Project Descr...

3CX PBX sync Windows Service Project Description: !! You require access to a commercial version of the 3CX PBX system in order to be able to program the API !! !! You requ

Manipulating objects in pl sql, Manipulating Objects: You can use an o...

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

Write a pl/sql anonymous block that accepts an employee id, Based on the EM...

Based on the EMPLOYEE table created in Assignment #1, write a PL/SQL anonymous block that accepts an employee ID from the user input and finds whether the employee ID is in the EMP

Character types in pl/sql, Character Types The Character types allow yo...

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

Variable declaration - sql, Variable Declaration - SQL SQL's support f...

Variable Declaration - SQL SQL's support for variables is very similar to Tutorial D's, except that the syntax for creating persistent  variables-base tables-is quite differen

Using rename in combination with join - sql, Using RENAME in combination wi...

Using RENAME in combination with JOIN - SQL Example gives pairs of ids of students having the same name, by joining two renamings of IS_CALLED. Example gives an equivalent ex

Use of table expressions - expressing constraint conditions, Use of Table E...

Use of Table Expressions - Expressing Constraint Conditions With the exception of key constraints, the examples in the theory book all explicitly reference at least one relvar

Features of pl/sql, Main features of PL/SQL A good way to get familiar ...

Main features of PL/SQL A good way to get familiar with PL/SQL is to look at a sample program. The below program processes an order for tennis rackets. At first, it declares a

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd