INOUT
Example
Section titled “Example”CREATE FUNCTION add_one(INOUT x integer) AS$$BEGIN x := x + 1;END;$$ LANGUAGE plpgsql;SELECT add_one(5);Output
Section titled “Output” add_one--------- 6(1 row)Explanation
Section titled “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
Section titled “Example”CREATE OR REPLACE PROCEDURE sample_inout (param1 IN OUT VARCHAR2) ASBEGINparam1 := 'Output: ' || param1;END;/
DECLAREparam_val VARCHAR2(50) := 'Sample Parameter';BEGINsample_inout(param_val);DBMS_OUTPUT.PUT_LINE(param_val);END;/Output
Section titled “Output”Output: Sample ParameterExplanation
Section titled “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’.