This website is for reference purposes only. Users are responsible for any misuse. The owner is not liable for any consequences.
Back to Database Management Systems (Laboratory)
6.1.1HardCODE

IN, OUT AND INOUT Parameters

Question

Solution

SQL

CREATE OR REPLACE PROCEDURE add_numbers(
     
     
       IN a INT,                -- Input parameter for the first integer
       IN b INT,                -- Input parameter for the second integer
       INOUT initial_result INT, -- INOUT parameter to receive and update the result
       INOUT final_result INT     -- Output parameter to return the final sum

)
LANGUAGE plpgsql
AS $$
BEGIN
	initial_result := a+b;
	final_result := initial_result;
END;
$$;

2/2 test cases passed

2/2 hidden test cases passed