Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Comparing field of RAW datatype
Sorry but i don't know OCI and its implicit conversion.
--
Regards
Michel
Sundar Raman <cybertoast_at_nopoop.mindless.com> a écrit dans le message :
3821BB3D.61513191_at_nopoop.mindless.com...
> Thanks Michel, this was exactly what I was looking for. I have one more
> question. When trying to compare a field of type RAW, does the hextoraw()
> function have to be used? For example, if I want to find out if the data in
> field rawfield is 0xEE007A, do I need to frame the query as:
> SELECT * FROM POOP
> WHERE RAWFIELD = hextoraw(:1)?
>
> :1 = EE007A, and the obind statement uses SQLT_BIN for the type.
> Or is Oracle smart enough to make the conversion without my specifying
> hextoraw()?
>
> Thanks a lot.
>
> Michel Cadot wrote:
>
> > There is the HEXTORAW function that converts a string
> > containing hexadecimal digits to raw value.
> >
> > update poop set rawfield=hextoraw('1234');
> >
> > this statement updates your row field with
> > 2 bytes: 0x12 and 0x34.
> >
> > --
> > Have a nice day
> > Michel
> >
> > Sundar Raman <cybertoast_at_mindless.com> a écrit dans le message :
> > 38218FC2.9CCAEC1D_at_nopoop.mindless.com...
> > > I hope this is a simple question - I've got a table that has a field of
> > > type RAW. I'd like to set the value to something in particular, but I
> > > can't find the function/procedure to do this. I'm using OCI. I'd
> > > prefer to have a SQL solution, meaning some function that works in SQL
> > > to do the translation of my data to the format that RAW expects, for
> > > example:
> > >
> > > update poop
> > > set rawfield = converttoraw(1234);
> > >
> > > where converttoraw is the magic solution to get the data into the field.
> > >
> > > Thanks a lot for all help. Cheers.
> > >
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Spam filter:
> Please remove "nopoop" from the address to reply to me directly.
>
>
Received on Fri Nov 05 1999 - 02:12:25 CST