Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Base64 to Blob

764649Apr 5 2010 — edited Jan 10 2011
Hi guys,

I am not an oracle expert. I am trying to insert a base64 data into a Blob. I was trying to use :

INSERT INTO MyDB.EXCELFILETABLE(FILELID,SPREADSHEETDATA,OWNER) values
( 1, utl_encode.base64_decode(utl_raw.cast_to_raw(b64Doc)),'owners' )

b64Doc is a base64 type string. I get the whole file as a base64 type.

I am getting this error that long can only be insert as Long. I get that RAW is actually a LONG. I don't understand that the method actually takes RAW so why it doesnt work.

I have searched on the net and ppl propose using a procedure. Can it not be done within a single sql.

I will really appreciate any help here.

thanks
mahdi
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 7 2011
Added on Apr 5 2010
7 comments
18,008 views