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!

copy long raw data from one table to another

sanjay kumar royApr 28 2015 — edited Aug 6 2018

CREATE OR REPLACE procedure HRD.proc_long_raw2 as

CURSOR MyCursor IS SELECT empno, emp_pic FROM emp_personal_old

where empno='100959';

vField1 varchar(20);                                                           

 

vRawField long raw;

iCount integer;

BEGIN

iCount := 0;

OPEN MyCursor;

LOOP

FETCH MyCursor INTO vField1, vRawField;

EXIT WHEN MyCursor%NOTFOUND;

iCount := iCount + 1;  

INSERT INTO emp_personal (empno, emp_pic)

VALUES (vField1,  vRawField);

--Commit every 10 rows

IF iCount = 10 THEN            

iCount := 0;

COMMIT;

END IF;

END LOOP;

COMMIT;  

CLOSE MyCursor; 

END;

/

Giving Error

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

ORA-06502: PL/SQL: numeric or value error

ORA-06512: at "HRD.PROC_LONG_RAW2", line 16

ORA-06512: at line 2

Table Create

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

CREATE TABLE HRD.EMP_PERSONAL

(

  EMPNO    VARCHAR2(20 BYTE),

  EMP_PIC  long raw

)

This post has been answered by John Stegeman on Apr 28 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 26 2015
Added on Apr 28 2015
5 comments
1,553 views