Oracle RAW format when read and converted to base64 works fine:
UTL_RAW.cast_to_varchar2(UTL_ENCODE.base64_encode(DBMS_LOB.substr(p_blob, len, 1)))
The above function requires looping though. But, I am trying to achieve this with mix-match of Oracle and Java:
DBMS_LOB.substr(column, 2000) AS col_1,
DBMS_LOB.substr(column, 2000, 2001) AS col_2,
DBMS_LOB.substr(column, 2000, 4001) AS col_3
I know the length of the column to be fixed (5000 or so). When I do the above I get string in the HEX format (probably ?) - sample below
C7A4B364A2C1FC7CFCCD35D0559BD70CA9E1FA09237E099A7B6BC1FFC106AD2BFE9599B
Now, I can read it as string in Java, but doing base64 encoding after reading it as string does not yield the same result as the Oracle equivalent (above first one). So, Oracle blob how to convert to string after getting string from dbms_lob.substr
? Also, the above looks hex but hex decode also fails.
To be precise, what is the equivalent of UTL_RAW.cast_to_varchar2 in Java?