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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle RAW data type -- What's it all about?

Re: Oracle RAW data type -- What's it all about?

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Thu, 7 Feb 2002 22:24:54 +0100
Message-ID: <u65s4kbjau8kde@corp.supernews.com>

"flitelog" <flitelog_at_yahoo.com> wrote in message news:54072b43.0201310653.38ff41d4_at_posting.google.com...
> Hi,
>
> I'm querying an Oracle database which has some RAW (binary?) fields in
> it. They are used as indexes and ID's.
>
> Anyhow, when I retrieve them in an ASP recordset I cannot do anything
> with them! I just want to print their ascii representation to a file.
>
> My code:
>
> val = cstr(RSQuery(x.Name))
> Out.WriteLine(val) '<=== this line causes an ERROR!
>
> I get an "invalid function call or parameter", because presumably the
> cstr did not succeed in forcing the RAW data field into an ascii
> field.
>
> What exactly is the RAW data type? In a SQLPLUS session the data
> looks like Hex -- but I can't force it to look the same in ASP.
>
> Anyone know how to get around this? I need to print something here,
> even if its just junk! ;-)
>
> Thanks.

Be prepared for a shock. The RAW datatype in Oracle is *never* used. Microsux products convert their long integers automatically to raw(16).

When using a RAW Oracle automatically *implicitly* converts to a HEX varchar2 string. Your cstr is unnecessary. Just because of the implicit conversion, you will now get a full table scan on the affected table, the indexes are not used, *NEVER* (Just did some research on a similar application today, the biggest table which is always subject to full table scan is now 9 million rows, and it grows with 3 million rows *per week*. All 'IDs' are RAW(16). You don't want to know how the app performs and how angry the customer is. Luckily we didn't develop it)

If you can return from what you are doing, *PLEASE* do so *NOW*, or you will end up in *HELL*

Regards

--
Sybrand Bakker
Senior Oracle DBA

to reply remove '-verwijderdit' from my e-mail address
Received on Thu Feb 07 2002 - 15:24:54 CST

Original text of this message

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