Export and import BLOB via text
adammsvkSep 15 2011 — edited Sep 16 2011Hello,
we need to migrate a table containing BLOB column from one environment to another. We can not use EXP or DBMS_DATA_PUMP, it has to be in form of SQL inserts (this is customer's requirement - no reason to think about it twice...)
My idea was to encode the blob to base64 and then decode it back to blob in the target system.
To try it out, I have created a procedure as
declare
b_blob blob;
v_varchar varchar2(32000);
begin
-- get some blob
select job_data into b_blob from qrtz_job_details where job_name = '83'
v_varchar := utl_encode.base64_encode(b_blob);
-- blobtest.column1 is of type blob
insert into blobtest (column1) values utl_encode.base64_decode(v_varchar2);
end;
I get error ORA-01461: can bind a LONG value only for insert into LONG column.
What am I doing wrong?
Any help appreciated.