Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> problem with accept statement in PL/SQL loops urgent please new message
Hi everybody,
My name is Kumaril Bhatt and I know SQL*plus.This is a new message. I
am also including the errors I encountered. The version of oracle Iam
using is 9.02. I have made some changes to the loop. The help needed
is urgent. Please bail me out. If I have to invoke PL/SQL from SQL,
Please provide me with script. I also used execute immediate statement
in the loop given below. But no fruitful results
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. If he says 'y' new rows are inserted in the table
DECLARE
ans char(1) :='y'; cid char(4); vid char(4);
begin
while(ans = 'y') loop
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 loop;
end;
SQL> @loop2.sql
24 /
accept cid prompt "Enter customer id : ";
*
ERROR at line 11:
ORA-06550: line 11, column 8: PLS-00103: Encountered the symbol "CID" when expecting one of the following:
Thank You very Much
Kumaril
Received on Thu Mar 13 2003 - 19:12:13 CST
![]() |
![]() |