INOUT
INOUT is a type of parameter mode in SQL stored procedures. This mode enables data to be passed to the procedure and returned back to the calling program. When a variable is declared with INOUT, the calling program can read the updated value of that variable after the procedure ends.
Example
Output
Explanation
In the example, a function called add_one
is created with an INOUT parameter x
. The function increases x
by 1 each time it is called. When the function is called with 5 as the input, the function returns 6. This is what the Output represents.
Example
Output
Explanation
The example presents a stored procedure sample_inout
in Oracle. The procedure accepts an IN OUT
parameter, concatenates it with the string ‘Output: ’, and outputs the final value. Upon executing the anonymous block, the given parameter is passed and modified inside the procedure. The output will be ‘Output: Sample Parameter’.