Sunday, 9 June 2013

Loop in PL/SQL

Create table suppliers29 (sup_id varchar2(10), sup_name varchar2(20),sup_address varchar2(20));


PL\SQL Block:

DECLARE
contin varchar2(10);
BEGIN
contin:='&contin';
while(contin='y')
loop
Insert into suppliers29 values ('&sup_id','&sup_name','&sup_address');
dbms_output.put_line('Want another (y/n)');
contin:='&contin';
if contin='n' then
exit;
end if;
end loop;
END;

No comments:

Post a Comment