php - mysql存储过程
本文介绍了php - mysql存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
DELIMITER $$
create procedure myproce2(in flag int)
begin
if flag=1 then
select * from t1
else
select * from t2
end
$$
不知道这个写法,哪里有语法问题,发现网上好多例子也是语法问题一大堆,求推荐个学习存储过程好的资料。
下面也是不行
DELIMITER $$
create procedure myproce2(in flag int)
begin
if flag=1 then
select * from t1
else
select * from t2
end if
end
$$
解决方案
漏加了 ;
DELIMITER $$
create procedure myproce2(in flag int)
begin
if flag=1 then
select * from t1 // 这个地方漏加了 `;`
else
select * from t2 // 同上
end
$$
推荐一个学习存储过程的网址:链接描述
这篇关于php - mysql存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文