Execute triggers stored procedures on SqlFiddle. Mysql

做~自己de王妃 提交于 2019-11-26 16:26:28

问题


Does SQL-fiddle facilitate execution of triggers/stored procedures?

I have been unable to execute even the simplest form of stored procedure on sqlfiddle

DELIMITER $$
DROP PROCEDURE IF EXISTS myProc $$

CREATE PROCEDURE myProc()
BEGIN

END$$
DELIMITER ;

Sqlfiddle does not allow executing this(above) sql in build schema, but allows create table etc

Note: The same syntax is working for me on my localhost using wamp with mysql 5.5.24

Can anyone guide please?


回答1:


Instead of using the delimiter option (which is not a real SQL statement, but rather only a command for the mysql command prompt) use the "Query Terminator" option on SQL Fiddle to establish your delimiter.

For example:

http://sqlfiddle.com/#!2/88fcf

Note the // dropdown below the schema box? That's the SQL Fiddle equivalent to the mysql DELIMITER command.

Longer example with queries in the stored procedure (note that within the stored procedure, ; is still used as a delimiter):

http://sqlfiddle.com/#!9/4db78

Full disclosure: I'm the author of SQL Fiddle.



来源:https://stackoverflow.com/questions/12166380/execute-triggers-stored-procedures-on-sqlfiddle-mysql

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!