-
Notifications
You must be signed in to change notification settings - Fork 10
/
uninstall.sql
50 lines (43 loc) · 2.42 KB
/
uninstall.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
prompt uninstall.sql
-- v0.1
prompt drop job (process queue)
begin dbms_scheduler.stop_job ('clicksend_process_queue'); exception when others then if sqlcode not in (-27366,-27475) then raise; end if; end;
/
begin dbms_scheduler.drop_job('clicksend_process_queue'); exception when others then if sqlcode not in (-27366,-27475) then raise; end if; end;
/
prompt drop job (purge logs)
begin dbms_scheduler.stop_job ('clicksend_purge_logs'); exception when others then if sqlcode not in (-27366,-27475) then raise; end if; end;
/
begin dbms_scheduler.drop_job('clicksend_purge_logs'); exception when others then if sqlcode not in (-27366,-27475) then raise; end if; end;
/
prompt drop queue
begin dbms_aqadm.stop_queue (user||'.clicksend_queue'); exception when others then if sqlcode!=-24010 then raise; end if; end;
/
begin dbms_aqadm.drop_queue (user||'.clicksend_queue'); exception when others then if sqlcode!=-24010 then raise; end if; end;
/
begin dbms_aqadm.drop_queue_table (user||'.clicksend_queue_tab'); exception when others then if sqlcode not in (-24010,-24002) then raise; end if; end;
/
prompt drop tables
begin execute immediate 'drop table clicksend_msg_log'; exception when others then if sqlcode!=-942 then raise; end if; end;
/
begin execute immediate 'drop table clicksend_settings'; exception when others then if sqlcode!=-942 then raise; end if; end;
/
prompt drop types
begin execute immediate 'drop type t_clicksend_msg'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
begin execute immediate 'drop type t_clicksend_lang_arr'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
begin execute immediate 'drop type t_clicksend_lang'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
begin execute immediate 'drop type t_clicksend_country_arr'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
begin execute immediate 'drop type t_clicksend_country'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
begin execute immediate 'drop type t_clicksend_sms_history_arr'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
begin execute immediate 'drop type t_clicksend_sms_history'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
prompt drop package
begin execute immediate 'drop package clicksend_pkg'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
prompt finished.