Page 1 of 1

Delphi 2010, Zeos 7 and parameters

Posted: 24.03.2010, 22:42
by zippo
Hello!

I noticed a strange behaviour of Zeos7 on Delphi 2010. If I execute something like this:

Qry.Sql.Text := 'INSERT INTO names Values (:ID, :FIRST, :LAST)';
Qry.ParameterByName('ID').AsInteger := 9;
Qry.ParameterByName('FIRST').AsString := 'X';
Qry.ParameterByName('LAST').AsString := 'Y';
Qry.ExecSQL;

Instead of this:
ID FIRST LAST
--------------------
9 X Y

I get table values like this:

ID FIRST LAST
--------------------
9 9 9

I hecked the param values just before execution and the values are OK. I think it's somewhere inside Zeos.

Hope it helps to improve my favorite components :)

Posted: 24.03.2010, 22:43
by zippo
BTW: How do I report the accurate verrsion of Zeos 7 ?

Posted: 25.03.2010, 10:34
by jeremicm
take a look at version property of ZConnection...

and for query try:

Code: Select all

Qry.Sql.Text := 'INSERT INTO names (ID, FIRST, LAST) Values (:ID, :FIRST, :LAST)';
Qry.ParameterByName('ID').AsInteger := 9;
Qry.ParameterByName('FIRST').AsString := 'X';
Qry.ParameterByName('LAST').AsString := 'Y';
Qry.ExecSQL;
Also instead of using

Code: Select all

Qry.Sql.Text := 'INSERT INTO names (ID, FIRST, LAST) Values (:ID, :FIRST, :LAST)';
i reccomend to use

Code: Select all

qry.sql.clear
qry.sql.add('INSERT INTO names (ID, FIRST, LAST) Values (:ID, :FIRST, :LAST)');

Posted: 26.03.2010, 15:02
by zippo
Ok, I Will try and report here.

Posted: 26.03.2010, 15:04
by zippo
Tried - unofrtunatly there's the problem persists.. :(

Posted: 05.04.2010, 13:18
by bravecobra
What's the revision of your svn checkout?

Posted: 13.04.2010, 22:11
by mdaems
zippo,

For reporting the 7.x version :
- When using SVN : branch + revision
- When using packaged download : what's the name of the file (or the branch and revision parts for snapshots)

Concerning the parameters problem:
- What's the used database?
- What SQL is the TZSQLMonitor reporting for the update part?

Mark