partytimeline_tb.sql 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. CREATE OR REPLACE PROCEDURE shanglifeecif.partytimeline_tb() -- 创建主存储过程
  2. IS
  3. BEGIN
  4. insert into shanglifeecif.partytimeline (
  5. TripID,
  6. PolicyNo,
  7. PartyID,
  8. name,
  9. PCertID,
  10. PRole,
  11. Scenario,
  12. SDate,
  13. enddate,
  14. created_by ,
  15. created_time
  16. ) select
  17. reflect("java.util.UUID", "randomUUID"),
  18. trim(contno) as contno,
  19. trim(max(customerno)) as customerno,
  20. trim(max(name)) as name,
  21. trim(max(idno)) as idno,
  22. '投保人',
  23. '投保',
  24. trim(max(polapplydate)) as polapplydate,
  25. trim(max(enddate)) as enddate,
  26. 'admin',
  27. sysdate()
  28. from dsj.policy_information WHERE contno IS NOT NULL GROUP BY contno;
  29. dbms_output.put_line('partytimeline_tb函数跑批完成!');
  30. EXCEPTION
  31. WHEN HIVE_EXCEPTION THEN
  32. INSERT INTO shanglifeecif.exception_log(log_id,log_code,log_msg,log_time) VALUES (to_char(sysdate(),'yyyyMMddHHmmss'),sqlcode(),sqlerrm(),sysdate());
  33. WHEN Others THEN
  34. INSERT INTO shanglifeecif.exception_log(log_id,log_code,log_msg,log_time) VALUES (to_char(sysdate(),'yyyyMMddHHmmss'),sqlcode(),sqlerrm(),sysdate());
  35. END;