IN Mode
It is the default argument mode in subprogram. This mode passes a constant value from the calling environment into the subprogram.
Example: The following example illustrates the working of IN Mode argument –
Query
SQL> CREATE OR REPLACE PROCEDURE PR1(X IN NUMBER, Y IN NUMBER)
S NUMBER;
BEGIN
S:=X+Y;
DBMS_OUTPUT.PUT_LINE('SUM IS : '||S);
END PR1;
Output
Procedure created.
Query
SQL> DECLARE
N1 NUMBER:=10;
N2 NUMBER:=20;
BEGIN
PR1(N1, N2);
END;
Output
SUM IS : 30
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: