Language:EN
Pages: 2
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
you dont need the data returned the out parameter

You dont need the data returned the out parameter

246

Chapter 9

Table 9.6

A parameter is an input parameter. Inside the

subprogram the parameter acts as a constant. It is
always passed by reference.

IN OUT

A parameter is both an input and output

parameter. It acts as an initialized value. By default
it is passed by value. Not allowed directly with
XSQL.

By default, parameters are passed as IN parameters. The following example shows how to specify each type:

CREATE OR REPLACE PROCEDURE priv_proc (defaultInParam NUMBER,

IS

-- declaration

PL/SQL 247

update_emp(emp_number=>7790,sal=>5000,name=>’EDWARDS’);

This is named notation as opposed to positional notation. Positional notation might look like this instead, assuming that the order of parameters in the update_emp defi-nition is name, emp_number, and sal.

First, a more extensive example using exceptions is needed. So far, you’ve had exception sections that only handle one exception. This example shows how you can use the exception section to handle multiple exceptions.

CREATE OR REPLACE PROCEDURE print_high_sal(sal_var IN OUT emp.sal%TYPE)

EXCEPTION

WHEN NO_DATA_FOUND THEN

DBMS_OUTPUT.PUT_LINE(‘unknown error’);

END;

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Adam Anderson

PageId: ELI51E9F0C