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 insert/update data having file content more than 1MB into the blob column in the table

1167823May 4 2017 — edited May 4 2017

Hi,

Environment: https://apex-stage.oraclecorp.com/pls/apex/f?p=4500:1003:111792236268001:::::

DB version : Oracle 12C

I tried to update the clob column to blob column in the same table having filesize more than(>32000 Byte, 10 MB, 100 MB) but it showing the below error message:

1. ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified: ORA-22275

2. ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 10490907, maximum: 32767)

3. ORA-22831: Offset or offset+amount does not land on character boundary

also function CLOB_TO_BLOB() is not working properly for fileszie more than >32000 and DBMS_LOB.converttoblob()

--------- Structure ----------------

CREATE TABLE "DOCUMENTS"

(

"SR_NO" NUMBER,

"FILE_CONTENT" CLOB,

"FILE_BLOB" BLOB

)

------- Code -------

declare

cursor c1 is select CLOB_TO_BLOB(file_content) as file_content2 from documents;

begin

update documents set file_blob = EMPTY_BLOB();

for rec in c1 loop

update documents set file_blob = rec.file_content2;

end loop;

end;

------------

So, can u please help me that how to update bulk amount of data into the blob column.

Thanks,

Saroj

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 1 2017
Added on May 4 2017
13 comments
2,182 views