Error performing PROCEDURE call in SQL Fiddle
When calling a PROCEDURE
in SQL Fiddle, the following error appears:
DDL and DML statements are not allowed in the query panel for MySQL; only SELECT statements are allowed. Put DDL and DML in the schema panel.
In the schema Build tab, I use the following query:
CREATE TABLE TEST( COD NUMERIC PRIMARY KEY UNIQUE,
DATESTART DATETIME,
DATEEND DATETIME);
INSERT INTO TEST
VALUES (1, '2019-03-29 10:20:57', '2019-04-29 10:20:57');
CREATE PROCEDURE PROC_TEST()
BEGIN
SELECT * FROM TEST;
END//
In the SQL execution tab:
CALL PROC_TEST()
Follows the fiddle used in the creation and calling of PROCEDURE
.
2 answers
Andre, This looks like a bug of SQL Fiddle in MySQL 5.6.
Another thread has already been answered with this in English . I asked konerak to take a look at Issue 5 on GitHub and thread in English .
I noticed that you are using the delimiter char as //
, but the code uses ;
, Keep all using //
example: http://sqlfiddle.com/#! 9 / e63b9c/2/0.
However to enrich the discussion and continue the idea of Bruno, the sequential commands could be used to better understand your environment:
Display current user permissions:
SHOW GRANTS FOR CURRENT_USER()//
Reference materials:
Https://dev.mysql.com/doc/refman/5.6/en/grant.html
Https://dev.mysql.com/doc/refman/5.6/en/privileges-provided.html#priv_execute
As a suggestion to test your code and know if SQLFiddle is interpreting your commands use a select before and after:
select * from TEST//
call PROC_TEST()//
select * from TEST//
Example: http://sqlfiddle.com/#! 9 / e63b9c/2/0
As next steps I suggest you create a MySQL base in a docker and test locally because in this case SQLFiddle is not meeting what it promises. Additionally how to deal with a project on GitHub open an Issue for the project. As I did for you here: https://github.com/zzzprojects/sqlfiddle3/issues/5
SQL Fiddle, perhaps for security does not let execute the procedure call in the execution tab.
The message is exactly this; DDL and DML statements are not allowed in the query panel for MySQL; only SELECT statements are allowed. Put DDL and DML in the schema panel.
Translating DDL and DML statements are not allowed in the MySQL query panel; only SELECT statements are allowed. Put DDL and DML in the panel of the schema.