update_partytimeline_add_salecom.sql 813 B

1234567891011121314151617181920
  1. CREATE OR REPLACE PROCEDURE shanglifeecif.update_partytimeline_add_salecom()
  2. IS
  3. BEGIN
  4. UPDATE shanglifeecif.partytimeline pt SET (pt.salecom,pt.salecomname) =
  5. (
  6. SELECT t.salecom, t.salecomname FROM
  7. (
  8. SELECT
  9. contno, salecom, salecomname
  10. FROM dsj.policy_information t
  11. GROUP BY contno, salecom, salecomname
  12. ) t WHERE t.contno = pt.policyno
  13. )
  14. dbms_output.put_line('update_partytimeline_add_salecom 函数跑批完成!');
  15. EXCEPTION
  16. WHEN HIVE_EXCEPTION THEN
  17. INSERT INTO shanglifeecif.exception_log(log_id,log_code,log_msg,log_time) VALUES (to_char(sysdate(),'yyyyMMddHHmmss'),sqlcode(),sqlerrm(),sysdate());
  18. WHEN Others THEN
  19. INSERT INTO shanglifeecif.exception_log(log_id,log_code,log_msg,log_time) VALUES (to_char(sysdate(),'yyyyMMddHHmmss'),sqlcode(),sqlerrm(),sysdate());
  20. END;