I need to use multiple statements in TZquery or TZReadOnlyQuery but it dont works.
This is the code:
Code: Select all
with ZQuery1 do
Sql.Add('DROP TABLE IF EXISTS table1 ; ');
Sql.Add('CREATE TABLE table1 SELECT field1, field2 FROM table2 ; ');
The error message is:
SQL Error: You have an error in your SQL syntax near ';
CREATE TABLE table1 SELECT field1, field2 FROM ' at line 1
If I execute in separate the first Sql (DROP ...) and then the second (Create table ...) and without the ";" it works fine.
It seems that I need to define the Delimiter for the Sql to ";" (like in TZSqlProcessor) but where can I define it?
Thanks in advance.