Details
-
Task
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Not a Bug
-
None
Description
Unlike Oracle, in MariaDB there's no possibility to use dynamic SQL (EXECUTE IMMEDIATE) for block of SQL statements (PL/SQL block), encapsulated in varchar string. Just a single DML statement a time. This raises some inconvenience for us in our current task to check option to port our solution to MariaDB.
Then we've checked the idea to create temporary procedure for such purpose, to execute a serie of statements (with loop, if-then constructs inside). But this failed as well, because this temporary procedure should be created on-fly from some other procedure, running on timely event, and you cannot issue
execute immediate 'create procedure...';
from within procedure.
Another option I've found in stackoverflow post, it offers creating procedure by INSERT INTO `mysql`.`proc` ... and then issue execute immediate 'call ...', but this seems to me quite wild.
Is there some other option to execute dynamically formed SQL block as single EXECUTE IMMEDIATE call?