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: BLOB Storage Issue

Re: BLOB Storage Issue

From: Scott <nospam_at_nomail.com>
Date: Thu, 16 Nov 2006 14:30:08 -0500
Message-ID: <6%27h.16138$bt1.73078@weber.videotron.net>


I did this on 10GR2

I am not sure of the conversion but if you had the value in raw wouldn't

to_number(utl_raw.cast_to_varchar2( YOUR_RAW_COLUMN ),'XXXXXXXXX')

which will convert a number from HEX to decimal.

My test was

select to_number('2540BE3FF','XXXXXXXXXX') from dual

TO_NUMBER('2540BE3FF','XXXXXXXXXX')


                                    9999999999

Hope that helps
Scott

"jimmy.brock" <jimmybrock_at_gmail.com> wrote in message news:1163704094.399384.144540_at_b28g2000cwb.googlegroups.com...
> We have a customer requirement to take a number data type field and
> covert it to a binary data type of 4-bytes, and reverse the order of
> the binary data. Then we are to write out the value to a file using the
> UTL_FILE package.
>
> This requirement is due to the fact that the customer is using an old
> legacy application to read the file and it can only read numbers that
> are in binary format and it reads numbers from right to left. Their
> application is excepting the data to always be 4-bytes regardless of
> the value.
>
> The number can by up to 10-digtits, so the max value would be
> 9,999,999,999.
> I tried using the RAW data type but it writes out HEX data, not what
> the customer wants.
> I tried using BLOB but the max value for 4-bytes is 128,100,000. Also,
> there is no way to resize a BLOB. The customer wants 4-bytes binary
> data, regardless if the value is 0 of 9 Billion.
>
> Any suggestions would be great!
>
Received on Thu Nov 16 2006 - 13:30:08 CST

Original text of this message

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