Subject Re: Setting VARCHAR length in a FB UDF
Author Fred P.
--- In firebird-support@yahoogroups.com, Dmitry Yemanov <dimitr@u...>
wrote:
> IMHO, it's much easier to use CSTRING type for the UDF arguments
instead of
> VARCHAR. Just use C-style (zero-terminated) strings and forget
about all
> your issues.
>
>
> Dmitry

Sorry, in my case, I can't use C strings. I have an application that
I'm trying to port from Oracle to FB. Most tables have at least a few
columns of data type "RAW". This is roughly the same as a VARCHAR but
contains binary data. These columns are typlically small (6 bytes
fixed length) but can get up to 128 bytes.

Anyway, I'm trying to write UDFs that will emulate Oracle's hextoraw()
and rawtohex() builtin functions used to store and retrieve binary
values from RAW columns. The return value from my hextoraw is a
VARCHAR of CHARACTER SET OCTETS and can contain zeros as valid data.
So, a C string will not do the job.

Thanks anyway,
Fred