Page 1 of 1

Prepare IBCQuery / too many Params

Posted: Wed 09 Jul 2014 12:46
by Jank
Hello,

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)
);
Now I have a Query with this SQL:

Code: Select all

select * from test where id = :id
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:

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;
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

Re: Prepare IBCQuery / too many Params

Posted: Thu 10 Jul 2014 10:05
by PavloP
Thank you for the information. We have fixed the error. The fix will be included in the next IBDAC build.
For now, we can send you a night build including the fix. Please send an email to pavelp*devart*com, in which specify your license number (if you are a registered user) and the exact version of the IDE you are using.

Re: Prepare IBCQuery / too many Params

Posted: Fri 18 Jul 2014 06:48
by Jank
Thank you very much, it's not so critical, I can wait for the next update. I am not really a fan of nightlys.

Re: Prepare IBCQuery / too many Params

Posted: Wed 20 Aug 2014 08:18
by PavloP
If any questions concerning our products come up, please contact us.