读书人

MYSQL存储过程,解决办法

发布时间: 2012-02-26 20:19:44 作者: rapoo

MYSQL存储过程,急!
各位好,请问下mysql如何创建,修改存储过程呀,我的mysql是5.1.17-beta版的
写了个最简单的存储过程都不行,错误如下,另外还想问下大家是如何修乞讨存储过程的,非常感谢!
======================================================================
错误
SQL 查询:

CREATE PROCEDURE p( ) BEGIN SELECT *
FROM pet
END

MySQL 返回:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select * from pet
END ' at line 3

[解决办法]
mysql> delimiter &&//临时结束符
mysql> create procedure p()
-> begin
-> select * from pet;
-> end;&&
mysql> delimiter ;
mysql> call p();

[解决办法]
在工具里面做,很简单
[解决办法]
.....肯定不行啊,select语句后要写封号...

读书人网 >Mysql

热点推荐