Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Interactive script using sequence to insert values
Hi,
I'm a newbie in Oracle & want to write a interactive script using a sequence to insert values into a table. In other words, here is what I'm trying to accomplish:
Here is my script but so far the syntax doesn't seem to be correct. Any helps/suggestions are appreciated.
DECLARE
count NUMBER := 1;
end_count NUMBER := '&end';
BEGIN
LOOP
ACCEPT c_lname - PROMPT 'Enter customer ''s last name: ' ACCEPT c_fname - PROMPT 'Enter customer ''s first name: ' ACCEPT address - PROMPT 'Address: ' ACCEPT city - PROMPT 'City: ' ACCEPT state - PROMPT 'State: ' ACCEPT zipcode - PROMPT 'Zip Code: ' ACCEPT phone - PROMPT 'Phone number: ' INSERT INTO customer VALUES (customer_c_id_seq.NEXTVAL,
count := count + 1;
EXIT WHEN count > end_count;
END;
/
TIA,
-Chris
Received on Thu May 10 2007 - 18:24:45 CDT
![]() |
![]() |