Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
4
Task/Exceptions/PL-pgSQL/exceptions-1.sql
Normal file
4
Task/Exceptions/PL-pgSQL/exceptions-1.sql
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
begin
|
||||
raise exception 'this is a generic user exception';
|
||||
raise exception division_by_zero;
|
||||
end;
|
||||
16
Task/Exceptions/PL-pgSQL/exceptions-2.sql
Normal file
16
Task/Exceptions/PL-pgSQL/exceptions-2.sql
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
create function special_division(p_num double precision, p_den double precision) returns text
|
||||
as $body$
|
||||
begin
|
||||
return p_num/p_den::text;
|
||||
EXCEPTION
|
||||
when division_by_zero then
|
||||
if p_num>0 then
|
||||
return 'Inf';
|
||||
ELSIF p_num<0 then
|
||||
return '-Inf';
|
||||
else
|
||||
return 'INDEF';
|
||||
end if;
|
||||
when others then
|
||||
raise;
|
||||
end;
|
||||
Loading…
Add table
Add a link
Reference in a new issue