Page 1 of 1

Error "input parameter count is less than expected"

Posted: 29.11.2013, 16:16
by M56OBER
Hello

In DELPHI XE and mySQL 5.0.37
I am using ZEOSDBO-7.1.2-Stable, When I modify a record have this error
"input parameter count is less than expected"

with the same query on other record i have no problem!

You have already seen it?

Thank you
Best regards

Re: Error "input parameter count is less than expected"

Posted: 29.11.2013, 18:05
by M56OBER
Can be a track?

The problem appears when we initialize in zero a key then when we try then to change this value.

We can observe that in this function

function TZEmulatedPreparedStatement.PrepareAnsiSQLQuery: RawByteString;

by

Re: Error "input parameter count is less than expected"

Posted: 29.11.2013, 21:27
by EgonHugeist
Hi,

An example or your code-spipped would be usefull. Than i can check what's going on..

Re: Error "input parameter count is less than expected"

Posted: 03.12.2013, 11:30
by M56OBER
CREATE TABLE `table01` (
`keyfield` int(11) NOT NULL default '0',
`dtfield` date NOT NULL default '0000-00-00',
`infofield` varchar(10) default NULL,
PRIMARY KEY (`keyfield`,`dtfield`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

qy := TZquery.create(application);
qy.Connection := Datamodule1.DOSOC;
qy.SQL.Text := 'select * from table01';
qy.Open;

qy.Append;
qy.FieldByName('keyfield').value := 1;
qy.FieldByName('dtField').value := Date;
qy.FieldByName('infofield').value := 'test';
qy.Post;

qy.Edit;
qy.FieldByName('keyfield').Value := 1;
qy.FieldByName('dtField').Value := NULL;
qy.FieldByName('infofield').AsString := 'test';
qy.Post;

qy.Edit;
qy.FieldByName('keyfield').value := 1;
qy.FieldByName('dtField').Value := date;
qy.FieldByName('infofield').value := 'test';
qy.Post;

qy.Free;

The las post cause an error "input parameter count is less then expected"
In fact the test of null value on keyfield don't work

In the code, we must test null value before post.

Re: Error "input parameter count is less than expected"

Posted: 03.12.2013, 16:36
by EgonHugeist
Nice, something to work with. I'll track your issue now.. Give you a second reply than.

Re: Error "input parameter count is less than expected"

Posted: 08.12.2013, 15:50
by EgonHugeist
Hi,

i was able to fix it (except you're using option doPreferPrepared -> will happen next).
Patch done \R2998 \testing-7.2.
I did add your example to our tests. So actually i've an error for MySQL-REALPrepareds. Hope i can resolve it too and i hope you can test it too?