Params Empty MySQL 5-Delphi 2010-Zeos 7

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
zhalcon
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 05.04.2010, 11:02

Params Empty MySQL 5-Delphi 2010-Zeos 7

Post by zhalcon »

Hi to everybody, first at all, thanks very much to all people do possible these great components and all of one help us in this forum.



My problem is:

With MySQL Server 5.0, Zeos 7.0 and Delphi 2010. If I test this:

ZQuery1.Close;
ZQuery1.SQL.Clear;
ZQuery1.SQL.Add('select * from table1 where field1= :param1');
ZQuery1.Params.ParamByName('param1').Value:=variable1;
ZQuery1.Open;


It launch an exception with the message of a sintax error in SQL command.
Monitoring commands to MySQL I see this sentence:

select * from table1 where field1=

Like empty param ????? But debugging I can see that variable1 has a value.
Last edited by zhalcon on 05.04.2010, 13:58, edited 2 times in total.
bravecobra
Junior Boarder
Junior Boarder
Posts: 29
Joined: 31.10.2005, 00:09
Location: Antwerp
Contact:

Post by bravecobra »

Since this resembles my experience perfectly...there is/was a bug concerning D2010 since widestrings are used there to pass param values instead of ansistrings.
I provided the patch here: http://zeos.firmos.at/viewtopic.php?t=2659. It has been commited to the trunk as rev 770, so you can update your checkout and try again.

If the problem persists, let us know.
Brave Cobra
bravecobra.com
zhalcon
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 05.04.2010, 11:02

Sorry, I've erased by error the question, repeat here

Post by zhalcon »

Thanks very much, Brave, I've downloaded your patch, because I don't know how download the REV 770 from SVN. I'll test it and write here the result.

I'll change ZDbcMySqlStatement.pas adding stUnicodeString like I've seen in your patch, build Zeos again and test it.


Again, thanks very much for your fast help.
zhalcon
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 05.04.2010, 11:02

FIX !!!

Post by zhalcon »

Hi Brave, certainly it was the answer. I applied your patch to ZDbcMySqlStatement.pas and it run OK.

Then, I saw another extrange thing. I used Zeos 6.5.1 and with that version, in ZQuerys linked like master and detail (by properties masterfield and mastersource, etc), when I inserted a record on detail, automatically, the keyfields on ZQuery detail were filled with the values of master ZQuery, but with Zeos 7 they are not. I had to fill property "LinkedFields" with the keyfields of detail to do automatically filled.

Thanks very much for your help, Brave.
slaut
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 10.05.2010, 14:36

Post by slaut »

Hi,

I have the same Problem with real Unicode parameters. I tried these:

Code: Select all

Query.SQL.Text := 'SELECT COUNT( IMPERIUM ) ANZ FROM IMPERIUM WHERE IMPERIUM = :IMP';
Query.ParamByName('IMP').AsString := '≡δŊΛ©Ξlөρюŋſ≡';
But the GetEscapeString Method is called with AnsiStrings, so that my Query has is 0.

Is there any fix?

Thanks,
slaut
Locked