-
Notifications
You must be signed in to change notification settings - Fork 24
/
install.sql
65 lines (40 loc) · 1.12 KB
/
install.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
create or replace package tq84_foo as
exc_one exception;
exc_two exception;
pragma exception_init(exc_one, -20731);
pragma exception_init(exc_two, -20732);
procedure throw_up(x in number);
end tq84_foo;
/
create or replace package body tq84_foo as
procedure throw_up(x in number) is
begin
if x = 1 then
raise_application_error(-20731, 'Exception one!');
end if;
if x = 2 then
raise_application_error(-20732, 'Exception two!');
end if;
raise_application_error(-20800, 'Other error');
end throw_up;
end tq84_foo;
/
create or replace package tq84_bar as
procedure proc(x in number);
end tq84_bar;
/
create or replace package body tq84_bar as
procedure proc(x in number) is
begin
tq84_foo.throw_up(x);
exception
when tq84_foo.exc_one or tq84_foo.exc_two then
dbms_output.put_line('tq84_bar caught ' || sqlerrm);
if sqlcode = -20731 then
raise;
end if;
when others then
raise;
end proc;
end tq84_bar;
/