select @a := field from table; and Mysql and TZQuery

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

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Ronalds
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 04.10.2006, 06:27

select @a := field from table; and Mysql and TZQuery

Post by Ronalds »

When i try to run application, i get error message

Incorrect token followed by '':"
...
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

What's the use of this in a sigle query?
Does the same problem arise in a ZSQLProcessor?
Anyhow, some more info would help a lot...

Mark
User avatar
dhongu
Junior Boarder
Junior Boarder
Posts: 37
Joined: 28.09.2005, 08:37
Location: Bucuresti
Contact:

Post by dhongu »

set ParamCheck with false
Dorin Hongu
Ronalds
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 04.10.2006, 06:27

Post by Ronalds »

I want use this construction for queryies like this:

select @a := (some long and complex expersion like case ... when),
@a+1,
@a+3,
@a*2

from some_table

Nice MySql feature. I don't need to rewrite complex expresions.

I try set ParamCheck = false but it does not help.....

Problem also is present in ZSQLProcessor.
When ParamCheck = True - Error message arrive in designer.
But when ParamCheck = false - then no errors from ZSQLProcessor.

My sugestion is - ZEOSLib try to use simbol after : as parameter (this is incorrect ofcourse)

Problem occurs in

procedure TZSQLStrings.RebuildAll;

....
{ Check for correct parameter type. }
if not (TokenType in [ttWord, ttQuoted]) then
raise EZDatabaseError.Create(SIncorrectToken);

here TokenType=ttSymbol and exception ofcourse....
User avatar
fduenas
Zeos Dev Team
Zeos Dev Team
Posts: 132
Joined: 26.08.2005, 08:12
Location: Cancún

Post by fduenas »

Hi Ronalds.
What version of ZeosDbo are you using?
because i have added the ':=' token to the mysql token list in /parsesql/ZMySqlToken.pas along time ago

Code: Select all

constructor TZMySQLSymbolState.Create;
begin
  inherited Create;
  Add('<=');
  Add('>=');
  Add('<>');
  Add('<<');
  Add('>>');
  {BEGIN PATCH: added by fduenas}
  Add(':=');
  {END PATCH: added by fduenas}
end;
But this code was added along time ago. you should download latest ZeosDBO SVN version to have this fix, or at least erv 98 that si already published in the download section.
Ronalds
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 04.10.2006, 06:27

Post by Ronalds »

I use zeos lib from file
ZEOS_TESTING_REV_102.7z

I have path

{BEGIN PATCH: added by fduenas}
Add(':=');
{END PATCH: added by fduenas}

But.... when i put break point on this line, my programm newer stop....
User avatar
fduenas
Zeos Dev Team
Zeos Dev Team
Posts: 132
Joined: 26.08.2005, 08:12
Location: Cancún

Post by fduenas »

Mmmmmm very strange, it you have added this lien point break and it doesn't stop, maybe your delphi is getting the librarty from anothert place. Plz make sure you dont´have any other folder with and older ZeosLib version in the library path of delphi.
Ronalds
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 04.10.2006, 06:27

Post by Ronalds »

to fduenas
When i put some break points in

function TZSQLStrings.FindParam(const ParamName: string): Integer;
debuger stop and file path is correct.
I try to debug, my sugestion - problem is in function

Tokens := Tokenizer.TokenizeBufferToList(Text,
[toSkipComments, toUnifyWhitespaces]);


But there is complex, inherited code.....
May be you can give some debuging tips ?

I use delphi 5. Maybe there is problem? You can't repeat problem? Because problem accours every time if select contains :=
Post Reply