Consider the stored procedure
CREATE PROCEDURE param_test (
IN P_in INT,
OUT P_out INT,
INPUT P_inout INT)
BEGIN
SELECT P_in, P_out, P_ inout;
SET P_in, P_inout
END
You execute a series of commands:
What is the output of the CALL and SELECT?
A.
(0,0,0) and (0,0,0)
B.
(0,0,0,) and (0,200,300)
C.
(0,NULL,0) and(0,200,300)
D.
(0,NULL,0) and (100,200,300)
It’s C.
The Question is wrong, the only reason I know this is because this is the same format used as an example in “MySQL 5.0 Certification Study Guide by Dubois, Hinz, and Pedersen” on page 290.
Here’s the real statement:
delimiter //
create procedure param_test
(IN p_in INT,
OUT p_out INT,
INOUT p_inout INT)
begin
SELECT p_in, p_out,p_inout;
set p_in = 100, p_out = 200, p_inout = 300;
end;
//
delimiter ;
set @v_in = 0, @v_out = 0, @v_inout = 0;
call param_test(@v_in, @v_out, @v_inout);
select @v_in, @v_out, @v_inout;
C