Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TSQLQuery.ExecSQL error with firebird

113 views
Skip to first unread message

SonGH

unread,
Aug 23, 2002, 9:12:28 PM8/23/02
to
hi,

I use Delphi 6 Enterprise and the dbExpress components, DB is firebird 1.0

---
SQLQuery1.SQL.Clear;
SQLQuery1.SQL.Add('DELETE FROM COUNTRY;');
SQLQuery1.ExecSQL;
---

it is run OK, but when i add other SQL, like ....

---
SQLQuery1.SQL.Clear;
SQLQuery1.SQL.Add('DELETE FROM COUNTRY;');
SQLQuery1.SQL.Add('DELETE FROM PHONE_LIST;');
SQLQuery1.ExecSQL;
--

I get the following error:

"Token unknown - line 2,char 1
DELETE"


How to settle ?
Thanks in advanced.


Wayne Niddery [TeamB]

unread,
Aug 23, 2002, 12:07:51 PM8/23/02
to
"SonGH" <songh...@sina.com> wrote in message
news:3d66...@newsgroups.borland.com...

>
> SQLQuery1.SQL.Clear;
> SQLQuery1.SQL.Add('DELETE FROM COUNTRY;');
> SQLQuery1.SQL.Add('DELETE FROM PHONE_LIST;');
> SQLQuery1.ExecSQL;
>
> I get the following error:
>
> "Token unknown - line 2,char 1
> DELETE"

A query component can only execute one statement at a time.


--
Wayne Niddery (Logic Fundamentals, Inc.)
RADBooks: http://www.logicfundamentals.com/RADBooks/delphibooks.html
It used to be that other people's achievements were considered an
inspiration, not a grievance.


Etem Emrah ALICLI

unread,
Aug 23, 2002, 7:16:52 PM8/23/02
to
You need to clear the SQL before deleting from another table.

SQLQuery1.SQL.Clear;
SQLQuery1.SQL.Add('DELETE FROM COUNTRY;');
SQLQuery1.ExecSQL;

SQLQuery1.SQL.Clear;


SQLQuery1.SQL.Add('DELETE FROM PHONE_LIST;');
SQLQuery1.ExecSQL;

This should work.


"SonGH" <songh...@sina.com> wrote in message
news:3d66...@newsgroups.borland.com...

Thomas Miller

unread,
Aug 27, 2002, 4:17:18 PM8/27/02
to
Try TSQLScript. It is part of dbExpress Plus

http://sourceforge.net/projects/dbexpressplus

or our web site.


--
Thomas Miller
Delphi Client/Server Certified Developer
BSS Accounting & Distribution Software
BSS Enterprise Accounting FrameWork

http://www.bss-software.com

0 new messages