Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Error in LastAutoInc
Thu, Feb 16 2006 6:19 PMPermanent Link

"Gabriel"
Delphi 7
dbisam 4.22 B5


I am having the mistake below in the the second query.

dbisam engine error 11949
- expected constant value but instead found "T09_ACER" in insert SQL ....


code source simplified:
===============

       DM.DATABASE1.STARTTRANSACTION

       DM.Query0.Close;
       DM.Query0.SQL.Clear;
       DM.Query0.SQL.Add('Insert into T09_ACER');
       DM.Query0.SQL.Add('( T09_Tombo )');
       DM.Query0.SQL.Add('Values       ');
       DM.Query0.SQL.Add('( 0         )');
       DM.Query0.ExecSQL;                                 //  ok

       DM.Query1.Close;
       DM.Query1.SQL.Clear;
       DM.Query1.SQL.Add('Insert into T10_AUAC             ');
       DM.Query1.SQL.Add('( T10_NumAcervo, T10_NumAutor   )');
       DM.Query1.SQL.Add('Values       ');
       DM.Query1.SQL.Add('( LastAutoInc("T09_ACER")  , 100    )');
// erro hear
       DM.Query1.ExecSQL;

       DM.DATABASE1.COMMIT


Can anybody make me a suggestion to solve this problem?

thank´s

Gabriel Fernandes
Brazil



Fri, Feb 17 2006 11:52 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Gabriel,

<< I am having the mistake below in the the second query.

dbisam engine error 11949
- expected constant value but instead found "T09_ACER" in insert SQL ....
>>

Use single quotes around the table name instead of double quotes inside of
the LASTAUTOINC() function.

--
Tim Young
Elevate Software
www.elevatesoft.com

Sat, Feb 18 2006 1:41 PMPermanent Link

"Gabriel"
using single quotes happens mistake in the compilation.

the solution that I found was to use:

vTable := "T09_LANC";
DM.Query1.SQL.Add ('(LastAutoInc (' + #39 + vTable + #39 + '), 100) ');

thank´s

Gabriel


"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> escreveu na
mensagem news:5E100F43-3879-4F53-BA52-B347B57B9EEB@news.elevatesoft.com...
> Gabriel,
>
> << I am having the mistake below in the the second query.
>
> dbisam engine error 11949
> - expected constant value but instead found "T09_ACER" in insert SQL ....
> >>
>
> Use single quotes around the table name instead of double quotes inside of
> the LASTAUTOINC() function.
>
> --
> Tim Young
> Elevate Software
> www.elevatesoft.com
>
>

Image