update_risk_categories.sql 744 B

12345678910111213141516171819
  1. CREATE OR REPLACE PROCEDURE shanglifeecif.update_risk_categories() -- 创建主存储过程
  2. IS
  3. BEGIN
  4. --更新险种大类
  5. UPDATE shanglifeecif.insurancearrangement a SET (
  6. risk_categories_name
  7. ) = (
  8. select
  9. kindtype
  10. from dsj.riskkind b WHERE a.productid = b.riskcode
  11. ) WHERE 1=1;
  12. dbms_output.put_line('update_risk_categories函数跑批完成!');
  13. EXCEPTION
  14. WHEN HIVE_EXCEPTION THEN
  15. INSERT INTO shanglifeecif.exception_log(log_id,log_code,log_msg,log_time) VALUES (to_char(sysdate(),'yyyyMMddHHmmss'),sqlcode(),sqlerrm(),sysdate());
  16. WHEN Others THEN
  17. INSERT INTO shanglifeecif.exception_log(log_id,log_code,log_msg,log_time) VALUES (to_char(sysdate(),'yyyyMMddHHmmss'),sqlcode(),sqlerrm(),sysdate());
  18. END;