cast RAW to number [message #313028] |
Thu, 10 April 2008 07:33  |
DeeDee
Messages: 14 Registered: March 2008
|
Junior Member |
|
|
Hi,
I have the problem that I need to cast a raw to a number. I did see the function "utl_raw.cast_to_number", but unfortunately this only returns a number containing the first 2 (or so) bytes, while the raw is 128 bits long and I want to store it in a number(16) :-/ any suggestions?
|
|
|
|
Re: cast RAW to number [message #313034 is a reply to message #313030] |
Thu, 10 April 2008 07:54   |
DeeDee
Messages: 14 Registered: March 2008
|
Junior Member |
|
|
is
result raw(128);
num number(16);
begin
select dbms_crypto.hash(utl_raw.cast_to_raw('asliie.sadfs'),
DBMS_CRYPTO.hash_md5)
into result from dual;
dbms_output.PUT_LINE(result);
num := utl_raw.cast_to_number(result);
DBMS_OUTPUT.PUT_LINE(num);
end test;
will give me the output:
8E3384498E9D99F721CAA00ED03BD641
0
Well, I do need the output from the hash function. It returns a RAW. Wikipedia said, that md5 hash functions return 128bit values :-/
[Updated on: Thu, 10 April 2008 10:33] by Moderator Report message to a moderator
|
|
|
|
|