This question about Using an extension: Answered but needs rewriting
Multiple query execution
Hi
Is it possible to do multiple sql queries from one sqlplugin line?
For example, see the code below:
%SQL{database="projectdatabase" query="INSERT INTO projecttasks (TaskName) VALUES ('task44'); INSERT INTO linkprojectandtasks (ProjectEntry, TaskEntry) VALUES ('1',LAST_INSERT_ID());"}%
For an unknown reason the the last sql query returns an error. If I execute the query in phpmyadmin it work on the same database.
Regards
Ritchie
Hallo Ritchie,
Happy new year 2012 !
Please try:
%SQL{database="..." query="BEGIN INSERT INTO ... ; INSERT INTO ... ; END;"}%
and/or
%SQL{database="..." "BEGIN INSERT INTO ... ; INSERT INTO ... ; END;"}%
I have tested it successfully with Oracle DB. (Foswiki 1.1.4)
Best regards,
VeredLevy