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!

Get Long Raw data from DB

2965000Jun 6 2017 — edited Jun 14 2017

I currently need to get data which is a 'LONG RAW' data type and then re-insert the same data back as a new row in a table (I'm copying data).

I've created PL/SQL code but when pulling data which is a 'MS Word' document, I get ORA-06502 error: PL/SQL: numeric or value error.

Here is a snippet of my code:

t_doc_blob                LONG RAW;

t_blob_pdf                 BLOB;

CURSOR c1_data

SELECT values, long raw, blob, etc...

FOR c1r IN c1_data LOOP

         --INSERT of copied data to a table

         --INSERT into document table which has the long raw and blob columns, but I don't insert the large files here.

          -- get the large files from the SELECT

          SELECT doc_blob, doc_blob_pdf, doc_original_extension

          INTO t_doc_blob, t_blob_pdf, t_doc_original_extension

          FROM documents

          WHERE doc_seqnum = t_doc_seqnum

          AND doc_num = t_doc__num;

          EXCEPTION

          WHEN OTHERS THEN

                        ROLLBACK;

                        t_error_code := SQLCODE;

                        t_error_message := SQLERRM; = ORA-06502 error: PL/SQL: numeric or value error

          --UPDATE the document table with the large files, t_doc_blob, t_blob_pdf

END LOOP

Oracle 11 DB

Any help would be much appreciated.

Thank you,

William

This post has been answered by 2965000 on Jun 7 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 11 2017
Added on Jun 6 2017
11 comments
2,720 views