Subject | Problem with sqltype |
---|---|
Author | Helmut Steinberger |
Post date | 2003-11-15T06:37:30Z |
Hi,
I have a strange problem.
I use an udf to get a datevalue depending on 2 integer and 1 date
values.
The udf is defined like this:
DECLARE EXTERNAL FUNCTION mygetdateudf
INTEGER,
INTEGER,
DATE
RETURNS TIMESTAMP
ENTRY_POINT 'mygetdateudf' MODULE_NAME 'myudflib';
I use this udf in my application like that:
var
tsql : tib_cursor;
begin
tsql := tib_cursor.create;
tsql.sql.text := 'select mygetdateudf (:value1, :value2, value3) from
rdb$database';
tsql.parambyname ('value1').asinteger := 1;
tsql.parambyname ('value2').asinteger := 2;
tsql.parambyname ('value3').asdatetime := today;
tsql.first;
.....
end;
The strange thing is, that IBO tells me, that the parameter
tsql.parambyname ('value3') has the sqltype 496 which meens SQL_LONG.
So I get an exception when assigning today to the asdatetime
property of the parameter.
What could be the reason for this problem?
cu
Helmut
I have a strange problem.
I use an udf to get a datevalue depending on 2 integer and 1 date
values.
The udf is defined like this:
DECLARE EXTERNAL FUNCTION mygetdateudf
INTEGER,
INTEGER,
DATE
RETURNS TIMESTAMP
ENTRY_POINT 'mygetdateudf' MODULE_NAME 'myudflib';
I use this udf in my application like that:
var
tsql : tib_cursor;
begin
tsql := tib_cursor.create;
tsql.sql.text := 'select mygetdateudf (:value1, :value2, value3) from
rdb$database';
tsql.parambyname ('value1').asinteger := 1;
tsql.parambyname ('value2').asinteger := 2;
tsql.parambyname ('value3').asdatetime := today;
tsql.first;
.....
end;
The strange thing is, that IBO tells me, that the parameter
tsql.parambyname ('value3') has the sqltype 496 which meens SQL_LONG.
So I get an exception when assigning today to the asdatetime
property of the parameter.
What could be the reason for this problem?
cu
Helmut