日期:2014-05-16  浏览次数:20642 次

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语句后要写封号...