首页 新闻 会员 周边

mysql存储过程

0
悬赏园豆:20 [已关闭问题]

在mysql中我创建如下存储过程:

create procedure mypro()
begin
declare @temp int;
set @temp=3;
end //
创建这个存储过程的时候为什么会报错呢?如果把该存储过程中的@符号去掉,就可以创建成功了,请问在mysql存储过程中定义变量的时候有@和没有@有什么区别?

问题补充: create procedure mypro(IN @temp int) begin select * from t where t.id>@temp; end// 请问这样创建存储过程mypro会报错是为什么呢?(去掉@可以创建成功)
猛士的主页 猛士 | 初学一级 | 园豆:8
提问于:2010-05-18 21:46
< >
分享
其他回答(1)
0

有@的话不用declare了,直接set @temp = 3;行了

Gray Zhang | 园豆:17610 (专家六级) | 2010-05-19 00:26
0

declare temp int default 1;  

Astar | 园豆:40805 (高人七级) | 2010-05-19 07:18
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册