-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdrop-tables1.sql
81 lines (81 loc) · 3.08 KB
/
drop-tables1.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
declare
c int;
begin
select count(*) into c from user_tables where table_name = upper('DimAccount');
if c = 1 then
execute immediate 'drop table DimAccount';
end if;
select count(*) into c from user_tables where table_name = upper('DimBroker');
if c = 1 then
execute immediate 'drop table DimBroker';
end if;
select count(*) into c from user_tables where table_name = upper('DimCompany');
if c = 1 then
execute immediate 'drop table DimCompany';
end if;
select count(*) into c from user_tables where table_name = upper('DimCustomer');
if c = 1 then
execute immediate 'drop table DimCustomer';
end if;
select count(*) into c from user_tables where table_name = upper('DimDate');
if c = 1 then
execute immediate 'drop table DimDate';
end if;
select count(*) into c from user_tables where table_name = upper('DimTime');
if c = 1 then
execute immediate 'drop table DimTime';
end if;
select count(*) into c from user_tables where table_name = upper('DimTrade');
if c = 1 then
execute immediate 'drop table DimTrade';
end if;
select count(*) into c from user_tables where table_name = upper('DImessages');
if c = 1 then
execute immediate 'drop table DImessages';
end if;
select count(*) into c from user_tables where table_name = upper('FactCashBalances');
if c = 1 then
execute immediate 'drop table FactCashBalances';
end if;
select count(*) into c from user_tables where table_name = upper('FactHoldings');
if c = 1 then
execute immediate 'drop table FactHoldings';
end if;
select count(*) into c from user_tables where table_name = upper('FactMarketHistory');
if c = 1 then
execute immediate 'drop table FactMarketHistory';
end if;
select count(*) into c from user_tables where table_name = upper('FactWatches');
if c = 1 then
execute immediate 'drop table FactWatches';
end if;
select count(*) into c from user_tables where table_name = upper('Industry');
if c = 1 then
execute immediate 'drop table Industry';
end if;
select count(*) into c from user_tables where table_name = upper('Financial');
if c = 1 then
execute immediate 'drop table Financial';
end if;
select count(*) into c from user_tables where table_name = upper('Prospect');
if c = 1 then
execute immediate 'drop table Prospect';
end if;
select count(*) into c from user_tables where table_name = upper('StatusType');
if c = 1 then
execute immediate 'drop table StatusType';
end if;
select count(*) into c from user_tables where table_name = upper('TaxRate');
if c = 1 then
execute immediate 'drop table TaxRate';
end if;
select count(*) into c from user_tables where table_name = upper('TradeType');
if c = 1 then
execute immediate 'drop table TradeType';
end if;
select count(*) into c from user_tables where table_name = upper('Audit_');
if c = 1 then
execute immediate 'drop table Audit_';
end if;
end;
exit