init_insuredno_salecom_relation.sql 845 B

12345678910111213141516171819202122232425
  1. CREATE OR REPLACE PROCEDURE shanglifeecif.init_insuredno_salecom_relation() IS
  2. DECLARE
  3. BEGIN
  4. -- 用户 渠道关系表
  5. insert into shanglifeecif.insuredno_salecom_relation (
  6. insuredno,
  7. salecomname,
  8. salecom
  9. )
  10. SELECT insuredno , salecomname ,salecom FROM (
  11. SELECT insuredno , salecomname ,salecom FROM dsj.POLICY_INFORMATION GROUP BY insuredno , salecomname,salecom
  12. ) t ;
  13. dbms_output.put_line('insuredno_salecom_relation 函数跑批完成!');
  14. EXCEPTION
  15. WHEN HIVE_EXCEPTION THEN
  16. INSERT INTO shanglifeecif.exception_log(log_id,log_code,log_msg,log_time) VALUES (to_char(sysdate(),'yyyyMMddHHmmss'),sqlcode(),sqlerrm(),sysdate());
  17. WHEN Others THEN
  18. INSERT INTO shanglifeecif.exception_log(log_id,log_code,log_msg,log_time) VALUES (to_char(sysdate(),'yyyyMMddHHmmss'),sqlcode(),sqlerrm(),sysdate());
  19. END;