Subject | Re: Problem with sqltype |
---|---|
Author | Helmut Steinberger |
Post date | 2003-11-17T07:28:49Z |
Hello Daniel,
When I set the date parameter on first place, evereything is o.k., but
when it is the 3nd or 3rd parameter it is interpreted as an integer
parameter.
because I do only use a datetime value which represents just a day
without the tim component. The value of the assigned datetime is for
example 37939 which meens Nov, 14th 2003.
Assigning this value to ib_query.parambyname ('dateparam').asdatetime,
brings me the errormessage '14.11.2003' is not a valid integer value.
I am realy frustrated about that. The whole thing was working o.k. a
time ago, but I think since I updated to FB1.5 it doesn't work any
more.
I just made a test with other kinds of parameters. When I use double
precision parameters, they are also interpreted as integer paramters,
if they are not in first place of the parameterlist.
I now tested a udf with 3 parameters.
Here is the definition of the udf:
DECLARE EXTERNAL FUNCTION TEST_UDF
date,
integer,
double precision
RETURNS INTEGER BY VALUE
ENTRY_POINT 'test_udf' MODULE_NAME 'testlib'^
When I look in the debugger, which sqltypes I get for each parameter
it will be displayed like that:
1st : 570
2nd: 496
3rd: 496
Then I changed the parameterordering in the udf:
DECLARE EXTERNAL FUNCTION TEST_UDF
integer,
date,
double precision
RETURNS INTEGER BY VALUE
ENTRY_POINT 'test_udf' MODULE_NAME 'testlib'^
When I look in the debugger, which sqltypes I get for each parameter
it will be displayed like that:
1st : 496
2nd: 570
3rd: 570
Then I changed the parameterordering in the udf:
DECLARE EXTERNAL FUNCTION TEST_UDF
double precision,
date,
integer
RETURNS INTEGER BY VALUE
ENTRY_POINT 'test_udf' MODULE_NAME 'testlib'^
When I look in the debugger, which sqltypes I get for each parameter
it will be displayed like that:
1st : 480
2nd: 570
3rd: 570
Then I changed the parameterordering in the udf:
DECLARE EXTERNAL FUNCTION TEST_UDF
date,
double precision,
integer
RETURNS INTEGER BY VALUE
ENTRY_POINT 'test_udf' MODULE_NAME 'testlib'^
When I look in the debugger, which sqltypes I get for each parameter
it will be displayed like that:
1st : 570
2nd: 480
3rd: 480
Then I tried without a dateparameter:
DECLARE EXTERNAL FUNCTION TEST_UDF
double precision,
double precision,
integer
RETURNS INTEGER BY VALUE
ENTRY_POINT 'test_udf' MODULE_NAME 'testlib'^
When I look in the debugger, which sqltypes I get for each parameter
it will be displayed like that:
1st : 480
2nd: 480
3rd: 480
It seems to me, that the first parameter is interpreted right, also
the second, but the third parameter always is interpreted as the same
type like the second.
Does nobody here have the same problems?
I cannot believe, that I am the only one having the need of UDFs with
more then 2 parameters.
cu
Helmut
>Probably it's the server that thinks it's an integer. If that wouldI tried both, but nothing did work as expected.
>be the case, then it could be a bug in Firebird. In Firebird's
>firebird.conf, did you put "OldParamtersOrdering = 1" or did you leave
>it as is? If you changed to 1, what happens if you change it to the
>default, which would be zero? Because of what I've heard, in Firebird
>1.5 the "OldParamterOrdering = 1" is just a simulation of the bug and
>not 100% guaranteed.
When I set the date parameter on first place, evereything is o.k., but
when it is the 3nd or 3rd parameter it is interpreted as an integer
parameter.
>And if the above does really apply to you, or fails.That brings me the same result. I just pass the integer portion,
>What happens if you pass the integer portion of your date value, which
>would represent the date itself? Simply use Trunc(Date Value) to
>achieve this.
because I do only use a datetime value which represents just a day
without the tim component. The value of the assigned datetime is for
example 37939 which meens Nov, 14th 2003.
Assigning this value to ib_query.parambyname ('dateparam').asdatetime,
brings me the errormessage '14.11.2003' is not a valid integer value.
I am realy frustrated about that. The whole thing was working o.k. a
time ago, but I think since I updated to FB1.5 it doesn't work any
more.
I just made a test with other kinds of parameters. When I use double
precision parameters, they are also interpreted as integer paramters,
if they are not in first place of the parameterlist.
I now tested a udf with 3 parameters.
Here is the definition of the udf:
DECLARE EXTERNAL FUNCTION TEST_UDF
date,
integer,
double precision
RETURNS INTEGER BY VALUE
ENTRY_POINT 'test_udf' MODULE_NAME 'testlib'^
When I look in the debugger, which sqltypes I get for each parameter
it will be displayed like that:
1st : 570
2nd: 496
3rd: 496
Then I changed the parameterordering in the udf:
DECLARE EXTERNAL FUNCTION TEST_UDF
integer,
date,
double precision
RETURNS INTEGER BY VALUE
ENTRY_POINT 'test_udf' MODULE_NAME 'testlib'^
When I look in the debugger, which sqltypes I get for each parameter
it will be displayed like that:
1st : 496
2nd: 570
3rd: 570
Then I changed the parameterordering in the udf:
DECLARE EXTERNAL FUNCTION TEST_UDF
double precision,
date,
integer
RETURNS INTEGER BY VALUE
ENTRY_POINT 'test_udf' MODULE_NAME 'testlib'^
When I look in the debugger, which sqltypes I get for each parameter
it will be displayed like that:
1st : 480
2nd: 570
3rd: 570
Then I changed the parameterordering in the udf:
DECLARE EXTERNAL FUNCTION TEST_UDF
date,
double precision,
integer
RETURNS INTEGER BY VALUE
ENTRY_POINT 'test_udf' MODULE_NAME 'testlib'^
When I look in the debugger, which sqltypes I get for each parameter
it will be displayed like that:
1st : 570
2nd: 480
3rd: 480
Then I tried without a dateparameter:
DECLARE EXTERNAL FUNCTION TEST_UDF
double precision,
double precision,
integer
RETURNS INTEGER BY VALUE
ENTRY_POINT 'test_udf' MODULE_NAME 'testlib'^
When I look in the debugger, which sqltypes I get for each parameter
it will be displayed like that:
1st : 480
2nd: 480
3rd: 480
It seems to me, that the first parameter is interpreted right, also
the second, but the third parameter always is interpreted as the same
type like the second.
Does nobody here have the same problems?
I cannot believe, that I am the only one having the need of UDFs with
more then 2 parameters.
cu
Helmut