Re: Raw data
Date: Fri, 28 Oct 2011 22:15:43 +0000 (UTC)
Message-ID: <pan.2011.10.28.22.15.42_at_gmail.com>
On Thu, 27 Oct 2011 13:30:36 -0400, NewtoOrcl wrote:
> I am trying to get the utl_raw.cast_from_number function to pass data to
> a 3rd party application. I am kind of confused as to how it gets
> converted into a binary format. Are these hexadecimal values? Why do
> the results vary so much in their length?
>
>
> 100 C202
> 200 C203
> 300 C204
> 400 C205
> 500 C206
> 1000 C20B
> 10000 C302
> 100000 C30B
> 1.2 C10215
These are not hexadecimal values. 0xC202=49666. Raw values usually denote how Oracle stores the results internally. I'm not sure that the way to calculate those is well documented. Why don't you use binary integers like this:SQL> select utl_raw.cast_from_binary_integer(100) from dual;
UTL_RAW.CAST_FROM_BINARY_INTEGER(100)
00000064
Elapsed: 00:00:00.01
SQL> select utl_raw.cast_from_binary_integer(257) from dual;
UTL_RAW.CAST_FROM_BINARY_INTEGER(257)
00000101
Those are hexadecimal values of 100 and 257 respectively.
-- http://mgogala.byethost5.comReceived on Fri Oct 28 2011 - 17:15:43 CDT