This is my NEW TABLE
SQL> DESC ORDERS;
Name Null? Type
----------------- -------- ----
ORDNO NOT NULL VARCHAR2(10) PRIMARY KEY
ADDRESS VARCHAR2(100)
GOODSDELAT VARCHAR2(75)
COMMENTS VARCHAR2(150)
DELDT VARCHAR2(10)
YEAR VARCHAR2(10)
QTNNO VARCHAR2(10) ----NEW FIELD ADDED (REFERENCE KEY OF TABLE QUOTATION)
This is my OLD TABLE
SQL> DESC ORDERS;
Name Null? Type
------------------------------- -------- ----
ORDNO VARCHAR2(10)
ADDRESS VARCHAR2(100)
GOODSDELAT VARCHAR2(75)
COMMENTS VARCHAR2(150)
DELDT VARCHAR2(10)
YEAR VARCHAR2(10)
My old table contains 800 recordsets.I want to import
data from this old table to new table.How can i fill QTNNO FIELD of new table.
My quotation table also contains 800 recordsets.
I am trying with following
DECLARE CURSOR C1 IS
SELECT QTNNO FROM QUOTATION_DETAILS;
QT QUOTATION_DETAILS.QTNNO%TYPE;
BEGIN
OPEN C1;
LOOP
FETCH C1 INTO QT;
INSERT INTO DYNE.ORDERS
VALUES(ORDNO,ADDRESS,GOODSDELAT,COMMENTS,ADVANCE,MOP,CHNO,CHDT,BANK,TOTAL,BANKNAME,
BANK_ADDRESS,FINAUTHORITY,PMTSTATUS,INSTR,DELMODE,DELDT,YEAR,QTNNO)
SELECT ORDNO,ADDRESS,GOODSDELAT,COMMENTS,ADVANCE,MOP,CHNO,CHDT,BANK,TOTAL,BANKNAME,
BANK_ADDRESS,FINAUTHORITY,PMTSTATUS,INSTR,DELMODE,DELDT,YEAR,'QT' FROM CYBER.ORDERS
WHERE QTNNO ='QT';
EXIT WHEN C1%NOTFOUND;
END LOOP;
CLOSE C1;
END;
/
but it giving me error From:
Apoorva Gala
You can mail me at apoo1972@rediffmail.com