Guest User

Untitled

a guest
Dec 17th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.37 KB | None | 0 0
  1. CREATE OR REPLACE package body KPC_CA is
  2.  
  3.  
  4. function find_change ( t_per_id KPCPAY.EMP_INF.per_id%type,
  5. shift1 KPCPAY.EMP_INF.shft1%type,
  6. shift2 KPCPAY.EMP_INF.shft2%type,
  7. shift3 KPCPAY.EMP_INF.shft3%type,
  8. wklyoff KPCPAY.EMP_INF.wklyoff%type,
  9. sup_name KPCPAY.EMP_INF.emp_name%type,
  10. sup_token_no KPCPAY.EMP_INF.r_emp_no%type,
  11. loc_desc KPCPAY.EMP_INF.loc_desc%type,
  12. dept_name KPCPAY.EMP_INF.dept_name%type,
  13. sbu KPCPAY.EMP_INF.sbu_id%type,
  14. effective_date date
  15. ) return number as
  16.  
  17. t_shift1 KPCPAY.EMP_INF.shft1%type;
  18. t_shift2 KPCPAY.EMP_INF.shft2%type;
  19. t_shift3 KPCPAY.EMP_INF.shft3%type;
  20. t_wklyoff KPCPAY.EMP_INF.wklyoff%type;
  21. t_sup_name KPCPAY.EMP_INF.emp_name%type;
  22. t_sup_token_no KPCPAY.EMP_INF.r_emp_no%type;
  23. t_location KPCPAY.EMP_INF.loc_desc%type;
  24. t_dept_name KPCPAY.EMP_INF.dept_name%type;
  25. t_sbu KPCPAY.EMP_INF.sbu_id%type;
  26.  
  27.  
  28. flag boolean := false;
  29.  
  30.  
  31. begin
  32. begin
  33. select shft1, shft2, shft3, wklyoff, loc_desc, r_emp_no,
  34. dept_name into t_shift1, t_shift2, t_shift3, t_wklyoff,
  35. t_location, t_sup_token_no, t_dept_name
  36. from KPCPAY.EMP_INF
  37. where per_id = t_per_id;
  38.  
  39.  
  40. select emp_name into t_sup_name
  41. from KPCPAY.EMP_INF
  42. where emp_no = (select r_emp_no
  43. from KPCPAY.EMP_INF
  44. where per_id = t_per_id);
  45.  
  46.  
  47. SELECT distinct(decode ( SUBSTR(ORGANIZATION_CODE, 1, 1),
  48. '1','CORP',
  49. '2','ACD',
  50. '3','TRM',
  51. '4','ACR',
  52. '5','RR',
  53. '6','RRS'
  54. )) "decode" into t_sbu
  55. from apps.org_organization_definitions
  56. where ORGANIZATION_ID= (select sbu_id
  57. from kpcpay.emp_inf
  58. where per_id = t_per_id);
  59.  
  60. end;
  61.  
  62.  
  63. begin
  64.  
  65. if t_shift1 != shift1 then
  66. flag := true;
  67. end if;
  68.  
  69. if t_shift2 != shift2 then
  70. flag := true;
  71. end if;
  72.  
  73. if t_shift3 != shift3 then
  74. flag := true;
  75. end if;
  76.  
  77. if t_wklyoff != wklyoff then
  78. flag := true;
  79. end if;
  80.  
  81. if t_sup_token_no != sup_token_no then
  82. flag := true;
  83. end if;
  84.  
  85. if t_sup_name != sup_name then
  86. flag := true;
  87. end if;
  88.  
  89. if t_location != loc_desc then
  90. flag := true;
  91. end if;
  92.  
  93. if t_dept_name != dept_name then
  94. flag := true;
  95. end if;
  96.  
  97. if t_sbu != sbu then
  98. flag := true;
  99. end if;
  100.  
  101. end;
  102.  
  103.  
  104. if flag = true then
  105. return 1;
  106. else
  107. return 0;
  108. -- or raise_application_error
  109. end if;
  110.  
  111. end find_change;
  112. end KPC_CA;
  113.  
  114. if ( (:p20_shift_1 != :p20_t_shift1) or
  115. (:p20_shift_2 != :p20_t_shift2) or
  116. (:p20_shift_3 != :p20_t_shift3) or
  117. (:p20_week_off != :p20_t_wklyoff) or
  118. (:p20_location != :p20_t_location) or
  119. (:p20_sup_token != :p20_t_sup_token) or
  120. (:p20_sup_name != :p20_t_sup) or
  121. (:p20_dept_name != :p20_t_dept) or
  122. (:p20_sbu != :p20_t_sbu)
  123. )
  124. then
  125. return true;
  126. else
  127. return false;
  128. end if;
  129.  
  130. :P1_POPUP_1 != :P1_POPUP_1_ORIG AND :P1_POPUP_2 != :P1_POPUP_2_ORIG ...
  131.  
  132. NVL( :P1_POPUP_1, '*' ) != NVL( :P1_POPUP_1_ORIG, '*' ) AND
  133. NVL( :P1_POPUP_2, '*' ) != NVL( :P1_POPUP_2_ORIG, '*' ) AND ...
Add Comment
Please, Sign In to add comment