Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Problem with accept in PL/SQL
Hi everybody,
My name is Kumaril Bhatt and I know SQL*plus. I am not that familiar
with PL/SQL. I want use loops in PL/SQL with user interaction. So I
tried using an accept statement in a PL/SQL loop. But I got errors. I
dont know much about scripts. So if any one could provide me with a
script, so that the loop below can be executed. The loop asks the user
whether he wants to insert more rows.
DECLARE
ans char(1) :='y'; cid char(4); vid char(4);
begin
while(ans = 'y')
accept cid prompt "Enter customer id : ";
accept vid prompt "Enter video id : ";
accept vname prompt "Enter videoname : ";
insert hire
values (cid,vid,vname);
accept ans prompt "Any more y/n : ";
end;
Thank You very Much
Kumaril
Received on Thu Mar 13 2003 - 02:24:22 CST