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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to do this

Re: How to do this

From: <fitzjarrell_at_cox.net>
Date: 2 Oct 2006 07:46:20 -0700
Message-ID: <1159800380.202061.171190@m7g2000cwm.googlegroups.com>

sjoshi wrote:
> I tried using the UTL_Raw package as in:
>
> Select UTL_Raw.cast_to_varchar2(S.ObjectMoniker) From CORESite S
>
> It dumps out contents like this
>
> p
> E
>
> for RAW values
>
> 700072006F006A00650063007400640062000000
> 4500230031003100340038003500350035003000380037000000
>
> Any ideas what I might be doing wrong here ?
>
> thanks
> Sunit
>
> sjoshi wrote:
> > Hello All
> >
> > For SQLServer I could cast the ObjectMoniker coln which is of varbinary
> > type to nvarchar to see if it's got the %OLE% string like in
> >
> > cast(S.ObjectMoniker as nvarchar(100)) like '%OLE%'
> >
> > How do I do this for Oracle ? In this case it is of type RAW(256). The
> > doc.says that there is Implicit Conversion to char type but I'm getting
> > only numbers when I try this :
> >
> > Select S.ObjectMoniker From CORESite S
> >
> > If I add the Where Clause, I get 0 rows
> >
> > Where S.ObjectMoniker Like '%OLE%'
> >
> > thanks
> > Sunit

Please stop top-posting.

And, provide which version of Oracle you're using; usable answers depend upon such information. As to your plight both 9.2.0.6 and 10.2.0.2 behave in this manner:

SQL> create table rawtest(testcol raw(256));

Table created.

SQL> insert into rawtest(testcol) values (utl_raw.cast_to_raw('This is a test of the utl_raw package'));

1 row created.

SQL> insert into rawtest
values('700072006F006A006500630074006400620000004500230031003100340038003500350035003000380037000000');

1 row created.

SQL> select utl_raw.cast_to_varchar2(testcol)   2 from rawtest;

UTL_RAW.CAST_TO_VARCHAR2(TESTCOL)



This is a test of the utl_raw package
p r o j e c t d b E # 1 1 4 8 5 5 5 0 8 7

SQL> I don't understand your 'problem' or why you have it, unless what you posted isn't correct as far as the source RAW value is concerned.

David Fitzjarrell Received on Mon Oct 02 2006 - 09:46:20 CDT

Original text of this message

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