Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: newbie: copy records from one table to another
"Yaroslav Perventsev" <p_yaroslav_at_cnt.ru> wrote in message news:<9jomq1$4m5$1_at_news247.cnt.ru>...
> and all? more code..?
There was no more code - just more fields.
> AFAIK...It's mean - table TRANSACTION havn't field CLIENT_ID.
Yes, I had the fields from a different table. Below is the entire code which I save into an SQL file and then run using SQL*Plus using the @c:... syntax.
DECLARE
CURSOR c1 IS
select * from TRANSACTION where TRANSACTION_DATE<'01-feb-00 00:00'
ORDER BY transaction_date;
BEGIN
OPEN c1;
FOR txn IN c1 LOOP insert into TRANSACTIONBACKUP values ( txn.TRANSACTION_ID, txn.TRANSACTION_DATE, txn.ORDER_ID, txn.AMOUNT, txn.PAYER, txn.PAYEE, txn.PAYER_ACCT_BAL, txn.PAYEE_ACCT_BAL, txn.TRANS_CODE ); delete from TRANSACTION where transaction_id = txn.transaction_id; commit; END LOOP; CLOSE c1;
DECLARE
*
ERROR at line 1:
ORA-06511: PL/SQL: cursor already open ORA-06512: at line 3 ORA-06512: at line 6
So it doesn't like the DECLARE statement. What should I do? Received on Mon Jul 30 2001 - 19:13:14 CDT