Subject Re: [firebird-support] dsql_execute2 and udf with blob input parameter
Author Geoff Worboys
Dimitry Sibiryakov wrote:
> No. isc_dsql_describe_bind returned sqllen for the
> parameter == 0. Thus the error on execute - generated BLR
> doesn't contain expected ISC_QUAD (8 bytes).

I saw that and actually tried injecting the 8 into the buffer
during debug, immediately before calling execute2... it seemed
to make no difference... but maybe I made a mistake (since I
was not certain it was the cause I did not push too hard).

> This is a bug. Until the fix, you can try to workaround
> it applying this statement to database:

> UPDATE RDB$FUNCTION_PARAMETERS SET RDB$FIELD_LENGTH=8 WHERE
> RDB$FIELD_TYPE=261;

> I think that must be enough to make your select statement
> above working.

Dimitry this is great! The above does work (after changing
the RDB$FUNCTION_PARAMETERS to RDB$FUNCTION_ARGUMENTS ;-).


You also wrote:
> BTW, in EXECUTE BLOCK you can do "test_result =
> UDF_PROCESS_BLOB(:X)", without SELECT.

Thanks, yes. (I also wanted to prove that the original
select statement worked in other circumstances.)


The beauty of the "SELECT ... FROM RDB$DATABASE" method for
testing is the ability to have FB supply the details of the
UDF parameter and return types. With execute block you have
to know all those details before you generate the test SQL
and that makes writing the test code much more complicated.
So your work-around will save me lots of work.

Thank you very much for the quick response... and thanks
even more for an effective work-around!

--
Geoff Worboys
Telesis Computing