Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: pro*c: raw to char
in the pro*c program, you need to tell Oracle that the datatype of your variable is RAW(8). i believe the syntax is something like this:
EXEC SQL VARIABLE myrawhostvar IS RAW(8);
this will tell Oracle that you are expecting a RAW(8) to be returned into the host variable, without conversion or translation, for example, from a statement like this:
EXEC SQL
SELECT myrawcol INTO :myrawhostvar
FROM mytable WHERE ROWNUM=1 ;
without the VARIABLE datatype declaration, the RAW data from the column is being converted by an implied RAWTOHEX function, which is the default when a RAW expression is cast to character.
the exact syntax rules and restrictions are documented in the Pro*C manual.
"Thomas Mielke" <Thomas_Mielke_at_t-online.de> wrote in message
news:97ovsd$tv1$05$1_at_news.t-online.com...
> a database table column is declared as raw(8).
>
> I want to retrieve the value into a char host variable,
> with or without ending zero, it doesn't matter.
>
> documentation tells me that raw data is not converted at all, but I can
only
> receive the raw(8) data into a char[16] variable. The converted data looks
> like a "sprintf (char_data, "%16.16X", raw_data)".
>
> is it possible to simply copy the raw(8) data into a char[8] variable,
> without any conversion?
>
> Thomas
>
>
>
>
Received on Sun Mar 04 2001 - 16:19:48 CST
![]() |
![]() |