00_precheck.sql 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. set define off
  2. set echo on
  3. whenever sqlerror exit sql.sqlcode
  4. alter session set container=ORCLPDB;
  5. alter session set current_schema=PMS_TEST;
  6. declare
  7. v_count number;
  8. begin
  9. select count(*)
  10. into v_count
  11. from PMS_TEST.GRCD
  12. where GRCDID = 1025885
  13. and GRCDMBID = 1011
  14. and MC = '班级评比'
  15. and JLZTM = 1;
  16. if v_count <> 1 then
  17. raise_application_error(-20001, '未找到有效的班级评比菜单父节点 1025885');
  18. end if;
  19. select count(*)
  20. into v_count
  21. from PMS_TEST.GRCD
  22. where SJGRCDID = 1025885
  23. and DXM = 'fjyrjc';
  24. if v_count <> 0 then
  25. raise_application_error(-20002, '风纪仪容检查菜单已存在,请勿重复安装');
  26. end if;
  27. select count(*)
  28. into v_count
  29. from PMS_TEST.GW
  30. where GWID in (102121, 1015484)
  31. and FWC is not null;
  32. if v_count <> 2 then
  33. raise_application_error(-20003, '目标岗位 FWC 不完整');
  34. end if;
  35. end;
  36. /
  37. select GRCDID,GRCDMBID,SJGRCDID,XH,MC,DXM,GNM,JLZTM
  38. from PMS_TEST.GRCD
  39. where SJGRCDID = 1025885
  40. order by XH,GRCDID;
  41. exit