business_write_detail.sql 1.78 KB
Newer Older
stone's avatar
stone committed
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
WHENEVER SQLERROR EXIT FAILURE ROLLBACK;
WHENEVER OSERROR  EXIT FAILURE ROLLBACK;

spool ACP_INVOICE_LN.log

PROMPT
PROMPT CREATING TABLE TRAIN_CONFIG
PROMPT ============================
PROMPT
CREATE TABLE business_write_detail (
     business_detail_id NUMBER,
     write_off_id      NUMBER,
     cashflow_id     NUMBER,
     contract_id     NUMBER,
     transaction_id  NUMBER,
     transaction_number VARCHAR2(100),
     transaction_type VARCHAR2(100),
     times          NUMBER,
     cf_item_n     VARCHAR2(100),
     extra_name    VARCHAR2(1000),
     contract_number  VARCHAR2(1000),
     machine_number  VARCHAR2(100),
     bp_code_tenant  VARCHAR2(100),
     bp_name    VARCHAR2(100),
     id_card_no VARCHAR2(100),
     contract_amount NUMBER,
     due_date  DATE,
     due_amount  NUMBER,
     due_amount_penalty NUMBER,
     transaction_date  DATE,
     write_off_date DATE,
     received_amount NUMBER,
     unreceived_amount NUMBER,
     received_amount_penalty NUMBER
);
CREATE SEQUENCE business_write_detail_s;
ALTER TABLE business_write_detail ADD (write_off_amount NUMBER);
ALTER TABLE business_write_detail ADD (session_id NUMBER);
ALTER TABLE business_write_detail ADD (rest_due_amount NUMBER);
CREATE SEQUENCE business_write_detail_s;
create index index_cashflowid on business_write_detail(cashflow_id);
drop index index_cashflowid;
select t.business_detail_id, write_off_id, cashflow_id, contract_id, transaction_id, transaction_number, transaction_type, times, cf_item_n, extra_name, contract_number, machine_number, bp_code_tenant, bp_name, id_card_no, contract_amount, due_date, due_amount, due_amount_penalty, transaction_date, write_off_date, received_amount, unreceived_amount, received_amount_penalty, write_off_amount, session_id, rest_due_amount from business_write_detail t;




SPOOL OFF

EXIT