Board index » delphi » Invalid use of keyword

Invalid use of keyword

I am trying to write a database restore routine whereby everytime a
transaction is posted to a table under a Delphi 3.0 program, the table
change is logged to a text file in the form of an SQL delete, insert, or
update statement.  If a database ever becomes corrupted then the plan would
be to copy this text file into a TQuery component and set the component as
active.  

With all that said here's the problem:
  I can run each of these statements individually without any problem,
however when I try to run them all at the same time I get a message under
the Database Desktop v.7 stating "Invalid use of keyword"  Below is a
sample list of the type of statements I am trying to execute separated by
comment markers /* */.

Delete From XTRATTEN
where ((StudentId =216156989) and (AttDate='08/10/1999'))
/* */
Insert into XTRATTEN values
(216156989, '08/10/1999', '01', 'U', '08/10/1999')
/* */
Insert into XTRATTEN values
(216156989, '08/10/1999', '04', 'T', '08/10/1999')
/* */
/* 08/12/1999 Backup */  

Any suggestions,  
Thanks JS

 

Re:Invalid use of keyword


What is your back-end database? If you're using something like Oracle, you
will need to separate multiple SQL statements with a semi-colon or forward
slash.

Natalie

Re:Invalid use of keyword


I am using a Paradox Database and tried putting semi-colons on the end of
the statements but still received the "Invalid use of keyword".  LL

Natalie Boodram <natal...@sirs.com> wrote in article
<7p1f8d$i4...@forums.borland.com>...

Quote
> What is your back-end database? If you're using something like Oracle,
you
> will need to separate multiple SQL statements with a semi-colon or
forward
> slash.

> Natalie

Re:Invalid use of keyword


TQuery does not accept multiple SQL statements.

Parse them and process them separately.

Cheers

Quote
Lon Layton wrote in message <01bee5a2$3e5568c0$1c5fa8c0@equiim>...
>I am trying to write a database restore routine whereby everytime a
>transaction is posted to a table under a Delphi 3.0 program, the table
>change is logged to a text file in the form of an SQL delete, insert, or
>update statement.  If a database ever becomes corrupted then the plan would
>be to copy this text file into a TQuery component and set the component as
>active.

>With all that said here's the problem:
>  I can run each of these statements individually without any problem,
>however when I try to run them all at the same time I get a message under
>the Database Desktop v.7 stating "Invalid use of keyword"  Below is a
>sample list of the type of statements I am trying to execute separated by
>comment markers /* */.

>Delete From XTRATTEN
>where ((StudentId =216156989) and (AttDate='08/10/1999'))
>/* */
>Insert into XTRATTEN values
>(216156989, '08/10/1999', '01', 'U', '08/10/1999')
>/* */
>Insert into XTRATTEN values
>(216156989, '08/10/1999', '04', 'T', '08/10/1999')
>/* */
>/* 08/12/1999 Backup */

>Any suggestions,
>Thanks JS

Other Threads