Error calling PROCEDURE in SQL Fiddle

Asked

Viewed 299 times

3

When making a call PROCEDURE in SQL Fiddle, the following error is displayed:

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 construction 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 call of PROCEDURE.

  • Andre, could you come on chat to talk about this tag [tag:sqlfiddle]? It was very confusing these editions adding the tag.

  • Hi @Andersoncarloswoss, I’m on chat.

2 answers

4

SQL Fiddle, maybe for security, won’t let you run 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 instructions are not allowed in the Mysql query panel; only SELECT instructions are allowed. Place DDL and DML in the schematic panel.

  • Charles, I answered below that this problem seems to be a bug in the tool interpreter using Mysql 5.6. In Mysql version 5.5 it looked like it was working as presented in an English thread. Additionally, as a recommendation, your answer could be in the comment area because it is an observation and translation and not a response with a greater degree of refinement. Abs.

  • What the execution of PRODECURES would negatively impact the security of Sqlfiddle? The execution of PROCEDURES would not be part of codes SQL?

  • Take a look at this one video. I do not know why this exception is launched. But I believe it is not for security

  • 1

    confirmed BUG in Sqlfiddle for Mysql 5.6 on the following Issue on github https://github.com/zzzprojects/sqlfiddle3/issues/5

0


André, this looks like a SQL Fiddle BUG in Mysql 5.6.

Another thread has already been answered with this in english. I asked the konerak to take a look at the Issue 5 on Github and the thread in english.

I noticed you’re using the delimiter char as // , but the code uses ; , keep everyone using // example: http://sqlfiddle.com/#! 9/e63b9c/2/0.

However to enrich the discussion and continue the idea of Bruno, the commands sequintes could be used for you 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 that you create a Mysql database on a Docker and test locally because in this case Sqlfiddle is not meeting what it promises. Add how it is a project on Github open an Issue for the project. As I did for you here: https://github.com/zzzprojects/sqlfiddle3/issues/5

  • Although using another delimiter character, this did not impact the execution of the code (the problem is in the run SQL). I already made the improvement in the question. What I want is to work on Sqlfiddle since I’m not getting.

  • 2

    SHOW GRANTS FOR CURRENT_USER()\\ would not be with the delimiter // ?

  • André, unfortunately as I mentioned in my reply this seems like a bug, I put another comment on github’s Issue to help you solve this problem as quickly as possible. It would be a good idea for you to go in there and post a comment, maybe it’ll help. I believe your question is answered at the moment, it seems can not be fixed without change in the Sqlfiddle code.

  • @Andréfilipe the Sqlfiddle maintainer replied that it is a BUG and will not have solution for this version, only for the future release without delivery date forecast. In English, the following Github font : https://github.com/zzzprojects/sqlfiddle3/issues/5

  • 1

    Thanks Rafael, that was not the perspective I planned to return, but what remains is to wait. Your answer and search was essential. Hugs!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.