0%

数据库大作业笔记(十)

MySQL存储过程中使用select…into…语句赋值

1
2
3
4
5
6
7
create procedure getMsg()  
Begin
declare v_title varchar(30);
declare v_content varchar(100);
select title,content into v_title,v_content from news where artId=333;
select v_title,v_content; -- 将变量作为结果集返回
End