OUT Mode
This mode passes a value from the subprogram to the calling environment and this mode is also used for sending the value to the end user and generally, it is used for writing purposes.
Example: The following example illustrates the working of OUT Mode argument –
Query
SQL> CREATE OR REPLACE PROCEDURE PR2(2 OUT NUMBER) AS
X NUMBER:=11;
Y NUMBER:=22;
BEGIN
Z:=X+Y;
END;
Output
Procedure created.
Query
SQL> DECLARE
R NUMBER;
BEGIN
PR2(R);
DBMS_OUTPUT.PUT_LINE('RESULT IS: '||R);
END;
Output
RESULT IS : 33
PL/SQL procedure successfully completed.
SQL>
Argument Modes in PL/SQL
Argument modes are basically used to describe the behavior of the formal parameters. There are three types of argument modes which are used in the sub-program, which are as follows –
- IN Mode
- OUT Mode
- IN OUT Mode
Arguments are the values that are passed to the PL/SQL blocks, subprograms, or functions. Arguments allow you to manipulate data in a dynamic manner. Here are some examples of how to use arguments in the PL/SQL language:
Contact Us