在SqlFiddle上执行触发器存储过程. MySQL的 [英] Execute triggers stored procedures on SqlFiddle. Mysql
问题描述
SQL小提琴是否有助于执行触发器/存储过程?
Does SQL-fiddle facilitate execution of triggers/stored procedures?
我什至无法执行sqlfiddle上最简单的存储过程形式
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不允许在构建模式中执行此(以上)sql,但允许创建表等
Sqlfiddle does not allow executing this(above) sql in build schema, but allows create table etc
注意:相同的语法在使用mysql 5.5.24的wamp在我的本地主机上正常工作
Note: The same syntax is working for me on my localhost using wamp with mysql 5.5.24
任何人都可以导游吗?
推荐答案
使用"Query Terminator"选项代替使用delimiter选项(这不是真正的SQL语句,而仅是mysql命令提示符下的命令)在SQL Fiddle上建立分隔符.
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.
例如:
http://sqlfiddle.com/#!2/88fcf
注意模式框下方的//
下拉列表吗?这就是SQL Fiddle,相当于mysql DELIMITER命令.
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
完全公开:我是SQL Fiddle的作者.
Full disclosure: I'm the author of SQL Fiddle.
这篇关于在SqlFiddle上执行触发器存储过程. MySQL的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!