WAP to use cursor in pl/sql
step-1 create a table
create table student(stdRollNo number, stdName varchar2(25),
stdClass varchar2(25)); RUN these COMMAND IF SUCCESSFULLY RUN THEN WRITE step-2 insert 2 or more values insert into student values(01,'ABC','XII'); RUN these COMMANDs, IF SUCCESSFULLY RUN THEN WRITE PL/SQL COMMAND step-3 declare vid number; vname varchar2(25); cursor std is select stdRollno,stdName from student where stdClass='XII'; begin open std; loop fetch std into vid,vname; exit when std%notfound; dbms_output.put_line(vid); end loop; close std; end;
No comments:
Post a Comment