1
drop table if exists t1;
3
a int not null primary key,
6
insert into t1 values (1,10), (2,20), (3,100), (4, 100);
7
create procedure test_proc1 (in var_in int)
9
select * from t1 where a = var_in;
11
create procedure test_proc2 (out var_out int)
13
select b from t1 where a = 1 into var_out;
15
create procedure test_proc3 (inout var_inout int)
17
select b from t1 where a = var_inout into var_inout;
23
call test_proc2(@test_var);
28
call test_proc3(@test_var);
32
alter procedure test_proc1 comment 'new comment';
33
show create procedure test_proc1;
34
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
35
test_proc1 CREATE DEFINER=`root`@`localhost` PROCEDURE `test_proc1`(in var_in int)
38
select * from t1 where a = var_in;
39
end latin1 latin1_swedish_ci latin1_swedish_ci
40
drop procedure test_proc1;
41
drop procedure test_proc2;
42
drop procedure test_proc3;