Steps
1. create table customer(id int,name char(20), age int, address char(20), salary int)
2. insert into customer values(1,'Raj',23,'Jalandhar',20000)
insert into customer values(2,'Raju',25,'Simraungadh',20000);
insert into customer values(3,'Ram',25,'Ludhania',25000);
insert into customer values(4,'Ramu',26,'Janakpur',30000);
insert into customer values(5,'Raman',29,'Birgunj',35000);
select*from customer
1. create table customer(id int,name char(20), age int, address char(20), salary int)
2. insert into customer values(1,'Raj',23,'Jalandhar',20000)
insert into customer values(2,'Raju',25,'Simraungadh',20000);
insert into customer values(3,'Ram',25,'Ludhania',25000);
insert into customer values(4,'Ramu',26,'Janakpur',30000);
insert into customer values(5,'Raman',29,'Birgunj',35000);
select*from customer
ID | NAME | AGE | ADDRESS | SALARY |
---|---|---|---|---|
1 | Raj | 23 | Jalandhar | 20000 |
2 | Raju | 25 | Simraungadh | 20000 |
3 | Ram | 25 | Ludhania | 25000 |
4 | Ramu | 26 | Janakpur | 30000 |
5 | Raman | 29 | Birgunj | 35000 |
set serveroutput on
declare
Total_rows number(2);
begin
update customer9999
set salary=salary+500;
if sql%notfound then
dbms_output.put_line('No customer selected');
else if sql%found then
Total_rows:=sql%rowcount;
dbms_output.put_line(Total_rows||'customer selected');
end if;
end if;
end;
Results
5customer selected
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
No comments:
Post a Comment