I'm trying to insert 18000 values into a table, and for order_id column the value is incremented with 1, and for the rest of the columns just insert whatever the select returns. When i try to run the query it returns that variable that stores the value appears to be null .
Here's what I tried :
DECLARE
order_id1 number := 1;
OrderID VARCHAR2(100);
i number := 1;
begin
WHILE i < 18000 LOOP
INSERT INTO Dummy_Table
SELECT OrderID,
CREATION_DATE,
email,
FIRST_NAME,
FIX_NO,
mobile_no,
SECOND_NAME,
SECOND_PHONE_NO,
TITLE
from Dummy_Table
i := i + 1;
OrderID := 'ABC' || to_char(order_id1 + 1);
END LOOP;
END;
In OrderID variable the string is stored which I wish to increment with 1 and insert it into order_id column from dummy_Table.
The error message is :
ORA-01400 Cannot insrt null into ("Dummy_Table"."order_id" at line 11