Page 1 of 1

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

Posted: 12.10.2006, 12:03
by Ronalds
When i try to run application, i get error message

Incorrect token followed by '':"
...

Posted: 12.10.2006, 13:13
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

Posted: 12.10.2006, 19:18
by dhongu
set ParamCheck with false

Posted: 13.10.2006, 12:03
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....

Posted: 13.10.2006, 14:24
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.

Posted: 13.10.2006, 16:02
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....

Posted: 13.10.2006, 20:43
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.

Posted: 14.10.2006, 06:06
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 :=