How dows TSQLScript operate? lazarus / 16-Databases ---------------------------------------------------------------------- egsuh · 2023-10-23 11:00 Does it send sqlstatements one by one, or at once? I found that Firebird supports EXECUTE BLOCK, for example in the case of inserting multiple records. It can be done with TSQLQuery with SQL statement like: Code: SQL  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i      EXECUTE BLOCK AS BEGIN        INSERT INTO table1 (f1, f2) VALUES (1, 2);         INSERT INTO table1 (f1, f2) VALUES (11, 12);               INSERT INTO table1 (f1, f2) VALUES (21, 22);         ....     END;  But with TSQLQuery I have to drop EXECUTE BLOCK statement itself. So, TSQLScript.Script would be Code: SQL  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i         INSERT INTO table1 (f1, f2) VALUES (1, 2);         INSERT INTO table1 (f1, f2) VALUES (11, 12);                 INSERT INTO table1 (f1, f2) VALUES (21, 22);         ....  without EXECUTE BLOCK AS BEGIN and END. If TSQLQuery sends each statement one by one, TSQLQuery using Execute Block would have merit in performance. ---------------------------------------------------------------------- Zvoni · 2023-10-23 11:51 ?!?!??! One shot instead of three.... Code: SQL  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i INSERT INTO table1 (f1, f2)         VALUES  (1, 2),                (11, 12),              (21, 22); ---------------------------------------------------------------------- egsuh · 2023-10-24 05:25 I've shown multiple insertions as an example, but there could be mixed statements of insert, delete, etc. ---------------------------------------------------------------------- Leledumbo · 2023-10-24 06:28 The wiki is your friend. ---------------------------------------------------------------------- Zvoni · 2023-10-24 06:33 Quote from: egsuh on October 24, 2023, 07:25:36 amI've shown multiple insertions as an example, but there could be mixed statements of insert, delete, etc. Don't!!! Don't mix Statements. Period. You might start a nuclear rocket in North Korea...... ---------------------------------------------------------------------- egsuh · 2023-10-24 07:55 QuoteThe wiki is your friend That means it is sent to DB server at once. Good news. QuoteYou might start a nuclear rocket in North Korea...... I may find out how to control them ---------------------------------------------------------------------- rvk · 2023-10-24 08:42 Quote from: egsuh on October 24, 2023, 09:55:52 amQuoteThe wiki is your friendThat means it is sent to DB server at once. Good news. What makes you think that? Look at the source (procedure TCustomSQLScript.ProcessStatement in fcl-db/src/base/sqlscript.pp). https://gitlab.com/freepascal.org/fpc/source/-/blob/main/packages/fcl- db/src/base/sqlscript.pp https://www.freepascal.org/docs-html/fcl/sqldb/tsqlscript.html ---------------------------------------------------------------------- egsuh · 2023-10-24 09:54 So it executes statements one by one using TSQLQuery. EXECUTE BLOCK in TSQLQuery is better option.