Subject | Re: [IBO] UDF Parameter Bug in IBO ???? |
---|---|
Author | Paul Hope |
Post date | 2003-11-17T22:53:53Z |
Helmut
I just tried it with IB5.6 and it worked fine. I didnt use parameters
though just
'select test_udf (1,2,2.9) from rdb$database' in IBManager.
This isnt the parameter ordering thing is it?
Regards
Paul
I just tried it with IB5.6 and it worked fine. I didnt use parameters
though just
'select test_udf (1,2,2.9) from rdb$database' in IBManager.
This isnt the parameter ordering thing is it?
Regards
Paul
----- Original Message -----
From: "Helmut Steinberger" <ibo@...>
To: <IBObjects@yahoogroups.com>
Sent: Monday, November 17, 2003 10:13 PM
Subject: Re: [IBO] UDF Parameter Bug in IBO ????
> >What version of IBO are you using?
>
> As I wrote in my last Post I uses the latest Version of IBO,
> downloaded yesterday. (4.3A)
>
> >Part of the problem has to do with me using the extended type in delphi
to
> >contain the value rather than a double. This is an area I've only
partially
> >addressed with the 3.4 release. Perhaps what I did in this release will
be
> >sufficient. Please get the latest and let me know. Use the eval version
if
> >you need to.
>
> I do not think, if it has something to do with the extended type.
> This was just an example with the double parameter.
> You can do it with every datatype.
> Fact is, that every parameter after the 2nd will be interpreted as the
> same datatype like the 2nd parameter.
>
> If you declare this UDF:
>
> DECLARE EXTERNAL FUNCTION TEST_UDF
> double precision,
> integer,
> date
> RETURNS integer BY VALUE
> ENTRY_POINT 'test_udf' MODULE_NAME 'testlib'^
>
> the 3rd parameter will be interpreted as integer.
>
> If you declare this UDF:
>
> DECLARE EXTERNAL FUNCTION TEST_UDF
> integer,
> date,
> double precision
> RETURNS integer BY VALUE
> ENTRY_POINT 'test_udf' MODULE_NAME 'testlib'^
>
> the 3rd parameter will be interpreted as date.
>
> If you declare this UDF:
>
> DECLARE EXTERNAL FUNCTION TEST_UDF
> date,
> integer,
> double precision
> RETURNS integer BY VALUE
> ENTRY_POINT 'test_udf' MODULE_NAME 'testlib'^
>
> the 3rd parameter will be interpreted as integer.
>
> If you declare this UDF:
>
> DECLARE EXTERNAL FUNCTION TEST_UDF
> date,
> double precision,
> integer
> RETURNS integer BY VALUE
> ENTRY_POINT 'test_udf' MODULE_NAME 'testlib'^
>
> the 3rd parameter will be interpreted as double.
>
> And so on.
>
> I hope that helps to understand what I meen.
>
> You can reproduce it by declaring an UDF like I described in my
> previous post.
>
> I repeat it here:
>
> The Pascal Code of the UDF :
>
> function test_udf (var intparam : integer;
> var intparam2 : integer;
> var doubleparam : double) : double; stdcall;
>
> begin
> doubleparam := (doubleparam + intparam + intparam2) / 2;
> result := doubleparam;
> end;
>
> The UDF is declared to FB like that:
>
> DECLARE EXTERNAL FUNCTION TEST_UDF
> integer,
> integer,
> double precision
> RETURNS double precision BY VALUE
> ENTRY_POINT 'test_udf' MODULE_NAME 'testlib'^
>
> Then set up an ib_query or ib_cursor and set the sql.text of it to
> select test_udf (:a, :b, :c) from rdb$database
>
> Then set
>
> ib_query.parambyname ('a').asinteger := 1;
> ib_query.parambyname ('b').asinteger := 2;
>
> until here it works.
>
> But if you try to set
> ib_query.parambyname ('c').asfloat := 2.9;
> you will get an exception: 2.9 is not a valid integer value.
>
> Please try it.
>
> cu
> Helmut
>
>
>
___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
> without the need for BDE, ODBC or any other layer.
>
___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
> keyword-searchable FAQ, community code contributions and more !
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>