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

QuestionForm edit

Subject Using an extension
Extension SqlPlugin
Version Foswiki 1.0.9
Status Answered but needs rewriting
Related Topics
Topic revision: r3 - 09 Feb 2012, VeredLevy
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy