[SOLVED] Executing multiple sql statements in UpdateSQL (TSQLQuery) lazarus / 16-Databases ---------------------------------------------------------------------- KoBraSoft · 2025-12-21 10:03 Hi, how to  execute multiple sql statements in UpdateSQL? With this Code: [Select]UPDATE OR INSERT INTO ARTIKELGRUPPENDATEN (PREIS, ANZAHL, ID) VALUES (:PREIS1, :ANZAHL1, :ID1) MATCHING (ID); UPDATE OR INSERT INTO ARTIKELGRUPPENDATEN (PREIS, ANZAHL, ID) VALUES (:PREIS10, :ANZAHL10, :ID10) MATCHING (ID); UPDATE OR INSERT INTO ARTIKELGRUPPENDATEN (PREIS, ANZAHL, ID) VALUES (:PREIS100, :ANZAHL100, :ID100) MATCHING (ID); in UpdateSQL i get Code: [Select]Token unknown - line 2, column 1 -UPDATE It looks like ";" is being ignored. Here is a similar topic: https://forum.lazarus.freepascal.org/index.php/topic,15179.msg81218.ht ml#msg81218 According this topic, it should work. ---------------------------------------------------------------------- Sieben · 2025-12-21 10:54 You have to use the connection component to achieve that, TSQLQuery itself cannot execute multiple statements. TSQL3Connection for example has a method called ExecSQL that can. That said, all SQL statements of TSQLQuery are in the end processed by the corresponding TSQLConnection anyway. ---------------------------------------------------------------------- CharlyTango · 2025-12-21 11:16 I never used multiple SQL Statements on a TSQLQuery at once. Not even with UpdateSQL. I solve such challenges with Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   TSQLQuery.ExecSQL;                  //one statement at a time  TSQLConnector.ExecuteDirect();   //one statement at a time   TSQLite3Connection.ExecuteDirect(); //every connection provides ExecuteDirect and one statement at a time    TSQLScript.ExecuteScript;  // all statements at once I doubt if parameters work in TSQLScript ---------------------------------------------------------------------- KoBraSoft · 2025-12-21 17:36 Quote from: CharlyTango on December 21, 2025, 12:16:33 pmI solve such challenges with Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   TSQLQuery.ExecSQL;                  //one statement at a time  TSQLConnector.ExecuteDirect();   //one statement at a time   TSQLite3Connection.ExecuteDirect(); //every connection provides ExecuteDirect and one statement at a time I doubt if parameters work in TSQLScript Yes, correct. Parameters does not work. But Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i (DataSet as TSQLQuery).FieldByName().AsString  instead of :parameter of in AfterPost does the job.