oracle拉链表怎么重跑,拉链表

create or replace procedure test.SP_SDI_S_CRM_CUST_PE_BASE_INFO (sp_today string,sp_job_id string,ret out int) is

DECLAREstepINT;

errmsg STRING;BEGIN

BEGIN TRANSACTIONret := 0put_line(substr(current_date(), 1,10));

step := 1;

put_line(current_time() ||": STEP01: 重跑删除 test.SDI_S_CRM_CUST_PE_BASE_INFO" );DELETE FROM test.SDI_S_CRM_CUST_PE_BASE_INFO WHERE job_seq_id >=sp_job_id;

put_line(current_time() ||": SETP01 重跑删除 test.SDI_S_CRM_CUST_PE_BASE_INFO 成功");

step := step + 1;

put_line(current_time() ||": STEP02: 重跑从历史表插入到 test.SDI_S_CRM_CUST_PE_BASE_INFO" );INSERT INTO test.SDI_S_CRM_CUST_PE_BASE_INFO SELECT cust_no,cert_type,cert_no,pecust_name,custname_short,cust_name_en,vip_cate,country,credit_level,is_freetax,btflbool,dimabool,sex,nty,mrg,btd,study_exp,degree,pay_acct,acct_wt_bk,year_income,fmy_ppl,inhbt_stat,cust_lev,bank_emp_ind,employee_typ,bank_stk_holder_ind,bank_party_ind,notes,xdzx_type,cust_qly,personal_insrc,insurance_dt,bad_record,is_ltc_credit_cust,native, eff_date,end_date,job_seq_id FROM test.HIS_S_CRM_CUST_PE_BASE_INFO WHERE new_job_seq_id=sp_job_id;

put_line(current_time() ||": SETP02 重跑从历史表插入到 test.SDI_S_CRM_CUST_PE_BASE_INFO 成功");

step := step + 1;

put_line(current_time() ||": STEP03: 重跑删除历史表原先数据 test.HIS_S_CRM_CUST_PE_BASE_INFO" );DELETE FROM test.HIS_S_CRM_CUST_PE_BASE_INFO WHERE new_job_seq_id>=sp_job_id;

put_line(current_time() ||"

你可能感兴趣的:(oracle拉链表怎么重跑)