Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> inserting records from a table to another using %rowtype
Hi I would like to copy records from table a to table b using %rowtype.
Here is the code I have so far. The error I get is on line 15 (FOR rec1 in ab_cur)
*
ERROR at line 15:
ORA-06550: line 15, column 13: PLS-00103: Encountered the symbol "AB_CUR" when expecting one of the following:
I hope someone can help.
Cheers.
DECLARE CURSOR ab_cur IS
SELECT * FROM a WHERE This = 1 AND That = 'Y';
b_rec b%rowtype;
BEGIN
OPEN ab_cur
FOR rec1 in ab_cur
LOOP
INSERT INTO b VALUES(rec1.????, rec1.????, rec1.????, rec1.????, rec1.????, rec1.????, rec1.????, rec1.????, rec1.????, rec1.????, rec1.????, rec1.????, rec1.????, rec1.????, rec1.????, rec1.????, rec1.????, rec1.????, rec1.????, rec1.????, rec1.????, rec1.????, rec1.????, );
EXIT WHEN ab_cur%NOTFOUND;
END LOOP;
CLOSE ab_cur
END;
Received on Mon May 16 2005 - 10:02:59 CDT