Assignment
6 Exception Handling : SET B
1)
project4=# create
or replace function f3() returns text as'
declare rec
record;
n int;
begin
select hours into
n from pe where pno in(select pno from project where pname=''Electronics'');
update pe set
hours=hours-2 where pno in(select pno from project where
pname=''Electronics'');
if(n-2=0)then
raise
notice''hours are 0'';
end if;
raise
notice''number : %'',n;
return'' '';
end'
language 'plpgsql';
CREATE FUNCTIO
project4=# select
f3();
NOTICE: number : 8
f3
----
(1 row)
project4=#
No comments:
Post a Comment