I have an SQL statement like this-
select utl_encode.utl_encode.base64_encode(IMAGE1)
from IPHONE.accidentreports
where "key" = 66
But when I run it I get this error-
ORA-00904: "UTL_ENCODE"."UTL_ENCODE"."BASE64_ENCODE": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
Error at Line: 2 Column: 8
I want to convert my BLOB
object into BASE64
. How could it be done?
Since the UTL_ENCODE.BASE64_ENCODE function works on RAWs, it will work with BLOBs up to 32767 bytes in
PL/SQL
or 4000 bytes in SQL.If your images are larger, you'll have to write your own function. Here's an example:
First of all
UTL_ENCODE.BASE64_ENCODE
works on binary representation of aRAW
value and the function looks like:So, considering
IMAGE1
is ofRAW
type:More on
CAST
ing here.