Board index » delphi » Insert query works in SQL Server not in Delphi

Insert query works in SQL Server not in Delphi

D3.0 C/S, MS SQL Server

This query runs fine in Sql Server but in Delphi I get an error:
Invalid use of keyword.  Token: time_acct

insert time_acct
 (CompNo, LoginID, ProgName, JobNo, JobDesc, StartStamp, EndStamp)
 select CompNo, LoginID, ProgName, JobNo, JobDesc, StartStamp,
EndStamp from period

Is there any sort of writeup describing other incompatibilities of MS
Sql and BDE?
_____________________
The Delphi Compendium
http://www.{*word*104}-matrix.com/delphi.htm

 

Re:Insert query works in SQL Server not in Delphi


On Tue, 17 Feb 1998 20:25:04 GMT,

Quote
fullerton.m...@SpamKiller.Remove.colteng.com wrote:
>D3.0 C/S, MS SQL Server

>This query runs fine in Sql Server but in Delphi I get an error:
>Invalid use of keyword.  Token: time_acct

>insert time_acct
> (CompNo, LoginID, ProgName, JobNo, JobDesc, StartStamp, EndStamp)
> select CompNo, LoginID, ProgName, JobNo, JobDesc, StartStamp,
>EndStamp from period

>Is there any sort of writeup describing other incompatibilities of MS
>Sql and BDE?

According to the SQL-92 specification, the INTO keyword of the INSERT
statement is not optional. If Microsoft SQL Server allows this, it is an
implementation-specific deviation from the standard and would prevent this
SQL statement from being valid under other systems.

Try adding the INTO keyword.

  INSERT INTO time_acct
  (CompNo, LoginID, ProgName, JobNo, JobDesc, StartStamp, EndStamp)
  SELECT CompNo, LoginID, ProgName, JobNo, JobDesc, StartStamp,
    EndStamp
  FROM period

**************************************************************************
Steve Koterski
Borland International, Inc.
http://www.borland.com/delphi
(Remove the "SPICEDHAM2" from the address. Death to spam-bots!)

Re:Insert query works in SQL Server not in Delphi


Quote
koter...@SPICEDHAM2borland.com (Steve Koterski) wrote:
>On Tue, 17 Feb 1998 20:25:04 GMT,
>fullerton.m...@SpamKiller.Remove.colteng.com wrote:

>>D3.0 C/S, MS SQL Server

>>This query runs fine in Sql Server but in Delphi I get an error:
>>Invalid use of keyword.  Token: time_acct

>>insert time_acct
>> (CompNo, LoginID, ProgName, JobNo, JobDesc, StartStamp, EndStamp)
>> select CompNo, LoginID, ProgName, JobNo, JobDesc, StartStamp,
>>EndStamp from period

>>Is there any sort of writeup describing other incompatibilities of MS
>>Sql and BDE?

>According to the SQL-92 specification, the INTO keyword of the INSERT
>statement is not optional. If Microsoft SQL Server allows this, it is an
>implementation-specific deviation from the standard and would prevent this
>SQL statement from being valid under other systems.

Hm... I got that format (no INTO) from a Sams book on SQL Server
[Unleashed].   Thank you Microsoft.

Quote
>Try adding the INTO keyword.

>  INSERT INTO time_acct
>  (CompNo, LoginID, ProgName, JobNo, JobDesc, StartStamp, EndStamp)
>  SELECT CompNo, LoginID, ProgName, JobNo, JobDesc, StartStamp,
>    EndStamp
>  FROM period

Worked perfectly thank you!

_____________________
The Delphi Compendium
http://www.{*word*104}-matrix.com/delphi.htm

Re:Insert query works in SQL Server not in Delphi


Quote
>Hm... I got that format (no INTO) from a Sams book on SQL Server
>[Unleashed].   Thank you Microsoft.

Hey, U wrote in your previuos message, that it _worked_ without INTO if U
tried on the server. So the book is correct.

But the BDE MSSQL driver is not. because it try to be more inteligent than
the server behind it.

so Thank you Driver.( or anyone who wrote it )

Horo

Other Threads