易截截图软件、单文件、免安装、纯绿色、仅160KB

mysql存储过程 - 其他数据库开发 / MySQL/Postgresql

在mysql存储过程中定义变量和参数时可有可无符号@,请问有@和没有@有什么区别?谢谢!

create procedure mypro()
begin
declare @temp int;
set @temp=3;
end //
创建这个存储过程的时候为什么会报错呢?

如果上面这个存储过程中不加@符号,存储过程能正常创建,这是为什么呢?


declare @temp int;

你不可以declare 一个 session 变量。

create procedure mypro(IN @temp int)
begin
select * from t where t.id>@temp;
end//
那请问这样创建存储过程mypro会报错又是为什么呢?(去掉@可以创建成功)

引用你不可以declare 一个 session 变量。


你要听楼上狼兄的话,自定义变量不要加@


相关问答:

mysql连接tomcat - Java / Web 开发

我已经按照教程上配置tomcat的server.xml
<Context path = "/POS" docBase = "POS" debug = "5" reloadable = "true" crossContext = "true" workDir = &quo ......

一个mysql中关于in子查询的问题 - Java / Web 开发

SELECT * from alarms where id in (select resource_id from res_products where product=22)
这个语句在mysql中为什么不能执行?我的mysql数据库是5.0.27版本的!
如果实在不行那么该用个什么语句代替效率更高呢 ......

mysql 累加运算 - 其他数据库开发 / MySQL/Postgresql

sp 程序
delimiter //
create procedure ma()
begin
declare i int default 0;
while i<11 do
set i=i+1;
select i;
end while;
end //
delimiter ;
1+2+...+9+10
为什么这个程序无法实现累加效果
/ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号