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
WHENEVER SQLERROR EXIT FAILURE ROLLBACK;
WHENEVER OSERROR EXIT FAILURE ROLLBACK;
spool CUS_DEPOSIT_CALC_OVERDUE_TMP.log
PROMPT
PROMPT CREATING TABLE CUS_DEPOSIT_CALC_OVERDUE_TMP
PROMPT ============================
PROMPT
WHENEVER SQLERROR CONTINUE
DROP TABLE CUS_DEPOSIT_CALC_OVERDUE_TMP;
WHENEVER SQLERROR EXIT FAILURE ROLLBACK
-- Create table
create table CUS_DEPOSIT_CALC_OVERDUE_TMP
(
calc_id NUMBER not null,
session_id NUMBER,
calc_date DATE,
due_date DATE,
contract_id NUMBER,
cashflow_id NUMBER,
f_overdue_amount NUMBER,
f_overdue_penalty_amt NUMBER,
overdue_principal NUMBER,
overdue_interest NUMBER,
overdue_amount NUMBER,
overdue_max_days NUMBER,
overdue_penalty_amt NUMBER,
created_by NUMBER,
creation_date DATE
);
-- Add comments to the table
comment on table CUS_DEPOSIT_CALC_OVERDUE_TMP
is '保证金代垫清单-罚息测算';
-- Add comments to the columns
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.calc_id
is 'PK';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.session_id
is 'session_id';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.calc_date
is '计算日';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.due_date
is '到期日';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.contract_id
is '合同id';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.cashflow_id
is '现金流id';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.overdue_principal
is '逾期本金';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.overdue_interest
is '逾期利息';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.overdue_amount
is '逾期租金';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.overdue_max_days
is '最大逾期天数';
comment on column CUS_DEPOSIT_CALC_OVERDUE_TMP.overdue_penalty_amt
is '逾期违约金';
-- Create/Recreate indexes
create index CUS_DEPT_CALC_OVERDUE_TMP_N1 on CUS_DEPOSIT_CALC_OVERDUE_TMP (SESSION_ID);
create index CUS_DEPT_CALC_OVERDUE_TMP_N2 on CUS_DEPOSIT_CALC_OVERDUE_TMP (CONTRACT_ID);
-- Create/Recreate primary, unique and foreign key constraints
alter table CUS_DEPOSIT_CALC_OVERDUE_TMP
add constraint CUS_DEPT_CALC_OVERDUE_TMP_PK primary key (CALC_ID);
/
SPOOL OFF
EXIT