|
DECLARE
--江苏银行 ren(人)xing(行)
--CURSOR cur1 IS SELECT * FROM exception_define a WHERE instr(a.report_id,'A')=1;
CURSOR cur1 IS SELECT * FROM exception_define a WHERE a.report_version='0690';
TYPE cur2 IS REF CURSOR ;
var1 cur2;
TYPE r_type IS RECORD(v1 Exception_Area.EXCEPTION_AREA%TYPE ,v2 Exception_Area.ATTENTION_AREA%TYPE );
var_Area r_type;
seq_id NUMBER;
BEGIN
FOR define IN cur1 LOOP
--取定义表的序列
SELECT seq_exception_define_id.nextval INTO seq_id FROM dual;
--插入定义biao(表)
INSERT INTO exception_define VALUES(seq_id,define.folume_value_type ,define.exception_formula,
'1010',define.report_id ,define.exception_attr ,define.folume_id ,define.data_range ,define.freq_id ,
define.flag ,define.bak1 ,define.bak2 ,define.bak3 ,define.bak4);
--插入map表(机构异chang(常)对应表)
INSERT INTO exception_org_map VALUES(seq_exception_orgmap_id.nextval,'331010000',seq_id,NULL,NULL,NULL,NULL );
--插入areabiao(表)(yi(异)常区间)
OPEN var1 For SELECT EXCEPTION_AREA, ATTENTION_AREA FROM EXCEPTION_AREA A
WHERE a.exception_id=define.exception_id
GROUP BY EXCEPTION_AREA, ATTENTION_AREA ;
LOOP
FETCH var1 INTO var_Area;
EXIT WHEN var1 % NOTFOUND;
INSERT INTO Exception_Area VALUES(seq_exception_area_id.nextval,seq_id,'1010','01',var_Area.v1,var_Area.v2,NULL,NULL,NULL,NULL);
END LOOP;
CLOSE var1;
END LOOP;
END;
--select * from exception_define t WHERE t.exception_formula='A1302_0908_C54'
http://www.javaxxz.com |
|