Skip to Main Content

SQL & PL/SQL

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!

How to pass BLOB column in cursor

844339Aug 25 2011 — edited Aug 25 2011
table T1 ( id number, data BLOB)
table T2 ( id number, data BLOB).

There is a script to get data from T1 into cursor, perform some logic, then insert that cursor data into T2:
for rec in ( select * from T1 )
loop
-- some logic
insert into T2 values ( rec.id, rec.data);
end loop;

The error is:
ERROR at line 1:
ORA-06550: line 11, column 164:
PL/SQL: ORA-00904: "DATA": invalid identifier
ORA-06550: line 11, column 31:
PL/SQL: SQL Statement ignored
ORA-06512: at line 204

Seem that the cursor is unable to contain BLOB data. A possible workaround is to rewrite to sth like
"insert into T2 select * from T1 where ...". But I am not exploring this path as it requires much changes to current script.

Is there any DBMS_LOB procs which is able to make BLOB data supported by cursor.

Can experts advice a solution? Thanks.

Edited by: user13315563 on Aug 25, 2011 2:43 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 22 2011
Added on Aug 25 2011
1 comment
2,647 views