Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: pro*c: raw to char

Re: pro*c: raw to char

From: Spencer <spencerp_at_swbell.net>
Date: Sun, 4 Mar 2001 16:19:48 -0600
Message-ID: <Xbzo6.42$KG6.81247@nnrp2.sbc.net>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US