Untitled

mail@pastecode.io avatar
unknown
plain_text
15 days ago
1.0 kB
2
Indexable
Never
create table student10
(roll_no number(10)primary key,
sname varchar(20),
age number(3),
course varchar(20));

insert into student10 values(11,'veena','22','belagavi');
insert into student10 values(12,'vinay','21','Dharwad');
insert into student10 values(13,'vijay','25','hubballi');
insert into student10 values(14,'vidhya','24','mysuru');
insert into student10 values(15,'vivek','23','bengaluru');

select* from student10;

create package pkg_student10 is
procedure updateRecord(sno student10.roll_no%type);
end pkg_student10;

create package body pkg_student10 is
procedure updateRecord(sno student10.roll_no%type)is
begin
update student10 set age=27 where roll_no=sno;
if SQL%found then
dbms_output.put_line('RECORD UPDATED');
else
dbms_output.put_line('RECORD NOT FOUND');
END if;
END updateRecord;
END pkg_student10; 

declare
sno student10.roll_no%type;
s_age student10.age%type;
snm student10.sname%type;
begin
sno:=:sno;
pkg_student10.updateRecord(sno);
end;

select* from student10;

Leave a Comment