Skip to content Skip to sidebar Skip to footer

Oracle Convert Raw To Date Format

I have a RAW field in my Oracle database that represents the date of user registered in system. The value is something like 24E2321A0000000000 However I need convert the value to t

Solution 1:

Maybe this will help:

SELECT utl_raw.cast_to_binary_integer('24E2321A0000000000') raw_to_int
FROM dual
/

Output is 36. I'm not sure if you need days or hours. Next example is about adding 36 hours to SYSDATE:

-- SYSDATE + 36/24 --SELECT SYSDATE+(utl_raw.cast_to_binary_integer('24E2321A0000000000')/24) my_date
FROM dual
/

MY_DATE
---------------------12/13/20134:29:22 AM

Solution 2:

please try one

declare
d date;
begin
   dbms_stats.convert_raw_value (hextoraw('7876070A010101'), d);
   dbms_output.put_line (d);
end;

Post a Comment for "Oracle Convert Raw To Date Format"