Prepare IBCQuery / too many Params
Posted: Wed 09 Jul 2014 12:46
Hello,
I have a Problem with IBDAC 5.3.8 an Delphi XE4.
I've a simple table with five fields:
Now I have a Query with this SQL:
I have to know the datatype of the param so I set "Options.DescribeParams = True".
If I set the SQL the paramcount = 1 (without known patatype) but if I prepare, I have paramcount = 6, one for each field and one for the param.
4 params has the paramtype pfOuteput and two (both the param ID) pfUnknown.
if i set "IBCQuery1.Parambyname('id').AsInteger := 1" and I open the query I get these exception:
Dynamic SQL Error
SQL error code = -804
SQLDA missing or incorrect version, or incorrect number/type of variables
This happens alsow, if I set one of the ID-parametes to the value.
My Code:
In Delphi 2009 with ibdac 3.50.9.20 it works like I expect, after the prepare I have a paramcount of 1. What have I to doo that it works like I expect an I still can open the query?
Greetings Jan
I have a Problem with IBDAC 5.3.8 an Delphi XE4.
I've a simple table with five fields:
Code: Select all
CREATE TABLE TEST (
ID INTEGER NOT NULL,
FIELD1 VARCHAR(10),
FIELD2 VARCHAR(10),
FIELD3 VARCHAR(10),
FIELD4 VARCHAR(10)
);Code: Select all
select * from test where id = :idIf I set the SQL the paramcount = 1 (without known patatype) but if I prepare, I have paramcount = 6, one for each field and one for the param.
4 params has the paramtype pfOuteput and two (both the param ID) pfUnknown.
if i set "IBCQuery1.Parambyname('id').AsInteger := 1" and I open the query I get these exception:
Dynamic SQL Error
SQL error code = -804
SQLDA missing or incorrect version, or incorrect number/type of variables
This happens alsow, if I set one of the ID-parametes to the value.
My Code:
Code: Select all
try
IBCConnection1.Connect;
caption := inttostr(IBCQuery1.ParamCount); // ParamCount = 1
IBCQuery1.Prepare;
caption := inttostr(IBCQuery1.ParamCount); // ParamCount = 6
IBCQuery1.Parambyname('id').AsInteger := 1;
IBCQuery1.Open; // Exception happens
IBCQuery1.Close;
except
On e:Exception do
Memo1.Lines.add(e.message);
end;
IBCQuery1.UnPrepare;
IBCConnection1.Disconnect;
Greetings Jan