TZSQLProcessor, unknown token

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
tam
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: 20.10.2006, 15:21

TZSQLProcessor, unknown token

Post by tam »

Latest zeos, Delphi 7, Createpos is TZSQLProcessor, Error is "unknown token"

Code: Select all

  With CreatePos.Script do begin
    Clear;
    Add('set @pos=0;');
    Add('update zeile set posnr=@pos:=@pos+1 where id=2');
  end;
  CreatePos.Execute;
tam
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: 20.10.2006, 15:21

Post by tam »

Sorry, the error msg is:

Incorrect token followed by ":"

This is a plain MySQL testcase:

Code: Select all

use test;

drop table if exists t1;
create table t1 (
  posnr int(12)
);

insert into t1 values (10),(20),(30);

select * from t1;

set @pos=0;
update t1 set posnr=@pos:=@pos+1;

select * from t1;

drop table t1;
And this is the result:

Code: Select all

posnr
10
20
30
posnr
1
2
3
tam
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: 20.10.2006, 15:21

Post by tam »

Any news on this one?
tam
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: 20.10.2006, 15:21

Post by tam »

Pls, anyone?
btrewern
Expert Boarder
Expert Boarder
Posts: 193
Joined: 06.10.2005, 18:51

Post by btrewern »

I would guess that Zeos is parsing your SQL to find parameters. Sees the = after the : and barfs. Not sure what needs to be done to fix this though. Try setting ParamCheck to False.

Regards,

Ben
tam
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: 20.10.2006, 15:21

Post by tam »

Thanks, seems to work.
Post Reply