partytimeline_xq.sql 933 B

1234567891011121314151617181920212223242526272829303132
  1. CREATE OR REPLACE PROCEDURE shanglifeecif.partytimeline_xq() -- 创建主存储过程
  2. IS
  3. BEGIN
  4. insert into shanglifeecif.partytimeline (
  5. TripID,
  6. PolicyNo,
  7. PartyID,
  8. name,
  9. PRole,
  10. Scenario,
  11. SDate,
  12. created_by ,
  13. created_time
  14. ) select
  15. reflect("java.util.UUID", "randomUUID"),
  16. lp.contno,
  17. lp.appntno,
  18. '',
  19. '投保人',
  20. '续期',
  21. to_char(lp.confdate,'yyyy-MM-dd'),
  22. 'admin',
  23. sysdate
  24. FROM dsj.ljapayperson lp WHERE lp.paycount > 1;
  25. dbms_output.put_line('partytimeline_xq函数跑批完成!');
  26. EXCEPTION
  27. WHEN HIVE_EXCEPTION THEN
  28. INSERT INTO shanglifeecif.exception_log(log_id,log_code,log_msg,log_time) VALUES (to_char(sysdate(),'yyyyMMddHHmmss'),sqlcode(),sqlerrm(),sysdate());
  29. WHEN Others THEN
  30. INSERT INTO shanglifeecif.exception_log(log_id,log_code,log_msg,log_time) VALUES (to_char(sysdate(),'yyyyMMddHHmmss'),sqlcode(),sqlerrm(),sysdate());
  31. END;