To insert multiple rows by getting the values from the user
Hi
I want to insert multiple rows into a table using user given values dynamically.
I am a beginner to PL/SQL. Below code is part of my big code. A_row_insert is 2 and A_count is 1 (initially). While i execute , it asks for input only once and insert the same data 2 times. I want to enter two different rows. Please guide/advise me on this.
while (A_count<=A_row_insert) loop
dbms_output.put_line('Enter the value for the row#'||A_count||' of the table '||v_req_tab_name||':');
begin
INSERT INTO customers (
customer# ,
lastname ,
firstname ,
address ,
city ,
state ,
referred ,
region
+)+
VALUES
+(+
+&customer,+
+'&lastname' ,+
+'&firstname' ,+
+'&address' ,+
+'&city' ,+
+'&state' ,+
+&referred ,+
+'®ion'+
+);+
end;
A_count := A_count 1;+
end loop;
regards
Sakthivel