1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

SELECT ... INTO local_vars ...;

For Stored Procedures
This commit is contained in:
unknown
2003-01-18 18:21:13 +02:00
parent 838303a731
commit 69047e719a
5 changed files with 105 additions and 12 deletions

View File

@ -124,6 +124,15 @@ insert into test.t1 values ("h1", x);
else
insert into test.t1 values ("h?", x);
end case;
create procedure sinisa()
begin
declare x char(16);
declare y int;
set x="aaaaa";
set y=22;
select id,data into x,y from test.t1 limit 2,1;
insert into test.t1 values (x, y);
end;
call foo42();
select * from t1;
id data
@ -236,6 +245,13 @@ id data
h0 0
h1 1
h? 17
call sinisa();
select * from t1;
id data
h0 0
h1 1
h? 17
h? 17
delete from t1;
drop procedure foo42;
drop procedure bar;
@ -258,4 +274,5 @@ drop procedure e;
drop procedure f;
drop procedure g;
drop procedure h;
drop procedure sinisa;
drop table t1;

View File

@ -187,6 +187,16 @@ else
insert into test.t1 values ("h?", x);
end case|
create procedure sinisa()
begin
declare x char(16);
declare y int;
set x="aaaaa";
set y=22;
select id,data into x,y from test.t1 limit 2,1;
insert into test.t1 values (x, y);
end|
delimiter ;|
# Now, the CALL tests...
@ -263,6 +273,8 @@ call h(0);
call h(1);
call h(17);
select * from t1;
call sinisa();
select * from t1;
delete from t1;
drop procedure foo42;
@ -286,5 +298,6 @@ drop procedure e;
drop procedure f;
drop procedure g;
drop procedure h;
drop procedure sinisa;
drop table t1;