Subject | Re: Setting VARCHAR length in a FB UDF |
---|---|
Author | Fred P. |
Post date | 2003-07-14T10:18:59Z |
--- In firebird-support@yahoogroups.com, Dmitry Yemanov <dimitr@u...>
wrote:
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
wrote:
> IMHO, it's much easier to use CSTRING type for the UDF argumentsinstead of
> VARCHAR. Just use C-style (zero-terminated) strings and forgetabout all
> your issues.Sorry, in my case, I can't use C strings. I have an application that
>
>
> Dmitry
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