update_insuranceclaimthread_add_salecom.sql 941 B

12345678910111213141516171819202122232425
  1. CREATE OR REPLACE PROCEDURE shanglifeecif.update_insuranceclaimthread_add_salecom()
  2. IS
  3. BEGIN
  4. UPDATE shanglifeecif.insuranceclaimthread insd
  5. SET (
  6. insd.SALECOM,
  7. insd.salecomname
  8. )
  9. =(SELECT t.salecom , t.salecomname FROM
  10. (
  11. SELECT
  12. contno, salecom , salecomname
  13. FROM dsj.policy_information t
  14. GROUP BY contno , salecom , salecomname
  15. ) t WHERE t.contno = insd.policyno
  16. -- AND t.contno in('2019012400157198','2019071600119318')
  17. )
  18. dbms_output.put_line('update_insuranceclaimthread add saleCome 函数跑批完成!');
  19. EXCEPTION
  20. WHEN HIVE_EXCEPTION THEN
  21. INSERT INTO shanglifeecif.exception_log(log_id,log_code,log_msg,log_time) VALUES (to_char(sysdate(),'yyyyMMddHHmmss'),sqlcode(),sqlerrm(),sysdate());
  22. WHEN Others THEN
  23. INSERT INTO shanglifeecif.exception_log(log_id,log_code,log_msg,log_time) VALUES (to_char(sysdate(),'yyyyMMddHHmmss'),sqlcode(),sqlerrm(),sysdate());
  24. END;