1: Package Body hxc_resource_rules_utils as
2: /* $Header: hxchrrutl.pkb 120.3.12010000.2 2008/08/05 12:03:04 ubhat ship $ */
3: --
4: g_debug boolean :=hr_utility.debug_enabled;
5:
6: PROCEDURE get_value_set_sql ( p_flex_Field_name varchar2
7: , p_legislation_code varchar2 ) IS
8:
261: l_seq NUMBER(2) := 1;
262:
263:
264: BEGIN
265: g_debug:=hr_utility.debug_enabled;
266: if g_debug then
267: hr_utility.set_location('gaz - in get sequence',10);
268: hr_utility.set_location('gaz - l seq is '||to_char(l_seq),10);
269: end if;
263:
264: BEGIN
265: g_debug:=hr_utility.debug_enabled;
266: if g_debug then
267: hr_utility.set_location('gaz - in get sequence',10);
268: hr_utility.set_location('gaz - l seq is '||to_char(l_seq),10);
269: end if;
270:
271: IF (SUBSTR(p_type, 1, 3) = 'SCL')
264: BEGIN
265: g_debug:=hr_utility.debug_enabled;
266: if g_debug then
267: hr_utility.set_location('gaz - in get sequence',10);
268: hr_utility.set_location('gaz - l seq is '||to_char(l_seq),10);
269: end if;
270:
271: IF (SUBSTR(p_type, 1, 3) = 'SCL')
272: THEN
270:
271: IF (SUBSTR(p_type, 1, 3) = 'SCL')
272: THEN
273: if g_debug then
274: hr_utility.set_location('gaz - in get sequence',20);
275: end if;
276:
277: -- loop to find a value - sometimes null when keyflex
278: -- has had different number of segments and concatenated segment value
280:
281: FOR scl IN csr_scl_get_seq
282: LOOP
283: if g_debug then
284: hr_utility.set_location('gaz - in get sequence',30);
285: end if;
286:
287: IF ( scl.application_column_name = SUBSTR( p_type, 5 ) )
288: THEN
295:
296: ELSIF ( SUBSTR( p_type, 1, 6) = 'PEOPLE' )
297: THEN
298: if g_debug then
299: hr_utility.set_location('gaz - in get sequence',40);
300: hr_utility.set_location('gaz - l seq is '||to_char(l_seq),10);
301: end if;
302:
303: FOR grp IN csr_people_get_seq
296: ELSIF ( SUBSTR( p_type, 1, 6) = 'PEOPLE' )
297: THEN
298: if g_debug then
299: hr_utility.set_location('gaz - in get sequence',40);
300: hr_utility.set_location('gaz - l seq is '||to_char(l_seq),10);
301: end if;
302:
303: FOR grp IN csr_people_get_seq
304: LOOP
302:
303: FOR grp IN csr_people_get_seq
304: LOOP
305: if g_debug then
306: hr_utility.set_location('gaz - in get sequence',50);
307: hr_utility.set_location('gaz - l seq is '||to_char(l_seq),10);
308: end if;
309:
310: IF ( grp.application_column_name = SUBSTR( p_type, 8 ) )
303: FOR grp IN csr_people_get_seq
304: LOOP
305: if g_debug then
306: hr_utility.set_location('gaz - in get sequence',50);
307: hr_utility.set_location('gaz - l seq is '||to_char(l_seq),10);
308: end if;
309:
310: IF ( grp.application_column_name = SUBSTR( p_type, 8 ) )
311: THEN
315: l_seq := l_seq + 1;
316:
317: END LOOP;
318: if g_debug then
319: hr_utility.set_location('gaz - in get sequence',60);
320: hr_utility.set_location('gaz - l seq is '||to_char(l_seq),10);
321: end if;
322:
323: ELSIF ( SUBSTR( p_type, 1, 5) = 'GRADE' )
316:
317: END LOOP;
318: if g_debug then
319: hr_utility.set_location('gaz - in get sequence',60);
320: hr_utility.set_location('gaz - l seq is '||to_char(l_seq),10);
321: end if;
322:
323: ELSIF ( SUBSTR( p_type, 1, 5) = 'GRADE' )
324: THEN
322:
323: ELSIF ( SUBSTR( p_type, 1, 5) = 'GRADE' )
324: THEN
325: if g_debug then
326: hr_utility.set_location('gaz - in get sequence',70);
327: hr_utility.set_location('gaz - l seq is '||to_char(l_seq),10);
328: end if;
329:
330: FOR grd IN csr_grade_get_seq
323: ELSIF ( SUBSTR( p_type, 1, 5) = 'GRADE' )
324: THEN
325: if g_debug then
326: hr_utility.set_location('gaz - in get sequence',70);
327: hr_utility.set_location('gaz - l seq is '||to_char(l_seq),10);
328: end if;
329:
330: FOR grd IN csr_grade_get_seq
331: LOOP
329:
330: FOR grd IN csr_grade_get_seq
331: LOOP
332: if g_debug then
333: hr_utility.set_location('gaz - in get sequence',80);
334: hr_utility.set_location('gaz - l seq is '||to_char(l_seq),10);
335: end if;
336:
337: IF ( grd.application_column_name = SUBSTR( p_type, 7 ) )
330: FOR grd IN csr_grade_get_seq
331: LOOP
332: if g_debug then
333: hr_utility.set_location('gaz - in get sequence',80);
334: hr_utility.set_location('gaz - l seq is '||to_char(l_seq),10);
335: end if;
336:
337: IF ( grd.application_column_name = SUBSTR( p_type, 7 ) )
338: THEN
342: l_seq := l_seq + 1;
343:
344: END LOOP;
345: if g_debug then
346: hr_utility.set_location('gaz - in get sequence',90);
347: hr_utility.set_location('gaz - l seq is '||to_char(l_seq),10);
348: end if;
349:
350: END IF;
343:
344: END LOOP;
345: if g_debug then
346: hr_utility.set_location('gaz - in get sequence',90);
347: hr_utility.set_location('gaz - l seq is '||to_char(l_seq),10);
348: end if;
349:
350: END IF;
351:
711:
712: IF ( SUBSTR( p_type,1,3) = 'SCL' )
713: THEN
714: if g_debug then
715: hr_utility.set_location('gaz - num of segs is '||to_Char(hxc_resource_rules_utils.g_scl_num_of_segs), 999);
716: end if;
717: IF ( hxc_resource_rules_utils.g_scl_num_of_segs IS NULL )
718: THEN
719: OPEN csr_get_scl_segs;
724: CLOSE csr_get_scl_segs;
725:
726: END IF;
727: if g_debug then
728: hr_utility.set_location('gaz - num of segs is '||to_Char(hxc_resource_rules_utils.g_scl_num_of_segs), 999);
729: end if;
730:
731: -- get sequence
732:
734:
735: -- get value
736:
737: if g_debug then
738: hr_utility.set_location('gaz - params are ', 999);
739: hr_utility.set_location('gaz - p id_flex_num '||to_char(hxc_resource_rules_utils.g_scl_id_flex_num) , 999);
740: hr_utility.set_location('gaz - p sequence '||to_char(l_Sequence) , 999);
741: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_scl_num_of_segs) , 999);
742: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_scl_delimiter , 999);
735: -- get value
736:
737: if g_debug then
738: hr_utility.set_location('gaz - params are ', 999);
739: hr_utility.set_location('gaz - p id_flex_num '||to_char(hxc_resource_rules_utils.g_scl_id_flex_num) , 999);
740: hr_utility.set_location('gaz - p sequence '||to_char(l_Sequence) , 999);
741: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_scl_num_of_segs) , 999);
742: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_scl_delimiter , 999);
743: hr_utility.set_location('gaz - p type '||p_type , 999);
736:
737: if g_debug then
738: hr_utility.set_location('gaz - params are ', 999);
739: hr_utility.set_location('gaz - p id_flex_num '||to_char(hxc_resource_rules_utils.g_scl_id_flex_num) , 999);
740: hr_utility.set_location('gaz - p sequence '||to_char(l_Sequence) , 999);
741: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_scl_num_of_segs) , 999);
742: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_scl_delimiter , 999);
743: hr_utility.set_location('gaz - p type '||p_type , 999);
744: hr_utility.set_location('gaz - p value '||p_value , 999);
737: if g_debug then
738: hr_utility.set_location('gaz - params are ', 999);
739: hr_utility.set_location('gaz - p id_flex_num '||to_char(hxc_resource_rules_utils.g_scl_id_flex_num) , 999);
740: hr_utility.set_location('gaz - p sequence '||to_char(l_Sequence) , 999);
741: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_scl_num_of_segs) , 999);
742: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_scl_delimiter , 999);
743: hr_utility.set_location('gaz - p type '||p_type , 999);
744: hr_utility.set_location('gaz - p value '||p_value , 999);
745: end if;
738: hr_utility.set_location('gaz - params are ', 999);
739: hr_utility.set_location('gaz - p id_flex_num '||to_char(hxc_resource_rules_utils.g_scl_id_flex_num) , 999);
740: hr_utility.set_location('gaz - p sequence '||to_char(l_Sequence) , 999);
741: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_scl_num_of_segs) , 999);
742: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_scl_delimiter , 999);
743: hr_utility.set_location('gaz - p type '||p_type , 999);
744: hr_utility.set_location('gaz - p value '||p_value , 999);
745: end if;
746:
739: hr_utility.set_location('gaz - p id_flex_num '||to_char(hxc_resource_rules_utils.g_scl_id_flex_num) , 999);
740: hr_utility.set_location('gaz - p sequence '||to_char(l_Sequence) , 999);
741: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_scl_num_of_segs) , 999);
742: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_scl_delimiter , 999);
743: hr_utility.set_location('gaz - p type '||p_type , 999);
744: hr_utility.set_location('gaz - p value '||p_value , 999);
745: end if;
746:
747: FOR scl IN csr_get_scl_meaning (
740: hr_utility.set_location('gaz - p sequence '||to_char(l_Sequence) , 999);
741: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_scl_num_of_segs) , 999);
742: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_scl_delimiter , 999);
743: hr_utility.set_location('gaz - p type '||p_type , 999);
744: hr_utility.set_location('gaz - p value '||p_value , 999);
745: end if;
746:
747: FOR scl IN csr_get_scl_meaning (
748: p_id_flex_num => hxc_resource_rules_utils.g_scl_id_flex_num
763:
764: ELSIF ( SUBSTR( p_type,1,6) = 'PEOPLE' )
765: THEN
766: if g_debug then
767: hr_utility.set_location('gaz - num of segs is '||to_Char(hxc_resource_rules_utils.g_people_num_of_segs), 999);
768: end if;
769: IF ( hxc_resource_rules_utils.g_people_num_of_segs IS NULL )
770: THEN
771: OPEN csr_get_people_segs;
776: CLOSE csr_get_people_segs;
777:
778: END IF;
779: if g_debug then
780: hr_utility.set_location('gaz - num of segs is '||to_Char(hxc_resource_rules_utils.g_people_num_of_segs), 999);
781: end if;
782:
783: -- get sequence
784:
786:
787: -- get value
788:
789: if g_debug then
790: hr_utility.set_location('gaz - params are ', 999);
791: hr_utility.set_location('gaz - p id_flex_num '||to_char(hxc_resource_rules_utils.g_people_id_flex_num) , 999);
792: hr_utility.set_location('gaz - l sequence '||to_char(l_Sequence) , 999);
793: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_people_num_of_segs) , 999);
794: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_people_delimiter , 999);
787: -- get value
788:
789: if g_debug then
790: hr_utility.set_location('gaz - params are ', 999);
791: hr_utility.set_location('gaz - p id_flex_num '||to_char(hxc_resource_rules_utils.g_people_id_flex_num) , 999);
792: hr_utility.set_location('gaz - l sequence '||to_char(l_Sequence) , 999);
793: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_people_num_of_segs) , 999);
794: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_people_delimiter , 999);
795: hr_utility.set_location('gaz - p type '||p_type , 999);
788:
789: if g_debug then
790: hr_utility.set_location('gaz - params are ', 999);
791: hr_utility.set_location('gaz - p id_flex_num '||to_char(hxc_resource_rules_utils.g_people_id_flex_num) , 999);
792: hr_utility.set_location('gaz - l sequence '||to_char(l_Sequence) , 999);
793: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_people_num_of_segs) , 999);
794: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_people_delimiter , 999);
795: hr_utility.set_location('gaz - p type '||p_type , 999);
796: hr_utility.set_location('gaz - p value '||p_value , 999);
789: if g_debug then
790: hr_utility.set_location('gaz - params are ', 999);
791: hr_utility.set_location('gaz - p id_flex_num '||to_char(hxc_resource_rules_utils.g_people_id_flex_num) , 999);
792: hr_utility.set_location('gaz - l sequence '||to_char(l_Sequence) , 999);
793: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_people_num_of_segs) , 999);
794: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_people_delimiter , 999);
795: hr_utility.set_location('gaz - p type '||p_type , 999);
796: hr_utility.set_location('gaz - p value '||p_value , 999);
797: end if;
790: hr_utility.set_location('gaz - params are ', 999);
791: hr_utility.set_location('gaz - p id_flex_num '||to_char(hxc_resource_rules_utils.g_people_id_flex_num) , 999);
792: hr_utility.set_location('gaz - l sequence '||to_char(l_Sequence) , 999);
793: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_people_num_of_segs) , 999);
794: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_people_delimiter , 999);
795: hr_utility.set_location('gaz - p type '||p_type , 999);
796: hr_utility.set_location('gaz - p value '||p_value , 999);
797: end if;
798:
791: hr_utility.set_location('gaz - p id_flex_num '||to_char(hxc_resource_rules_utils.g_people_id_flex_num) , 999);
792: hr_utility.set_location('gaz - l sequence '||to_char(l_Sequence) , 999);
793: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_people_num_of_segs) , 999);
794: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_people_delimiter , 999);
795: hr_utility.set_location('gaz - p type '||p_type , 999);
796: hr_utility.set_location('gaz - p value '||p_value , 999);
797: end if;
798:
799: FOR people IN csr_get_people_meaning (
792: hr_utility.set_location('gaz - l sequence '||to_char(l_Sequence) , 999);
793: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_people_num_of_segs) , 999);
794: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_people_delimiter , 999);
795: hr_utility.set_location('gaz - p type '||p_type , 999);
796: hr_utility.set_location('gaz - p value '||p_value , 999);
797: end if;
798:
799: FOR people IN csr_get_people_meaning (
800: p_id_flex_num => hxc_resource_rules_utils.g_people_id_flex_num
813:
814: END LOOP;
815:
816: if g_debug then
817: hr_utility.set_location('gaz - meaning is '||l_meaning, 999);
818: end if;
819:
820: ELSIF ( SUBSTR( p_type,1,5) = 'GRADE' )
821: THEN
819:
820: ELSIF ( SUBSTR( p_type,1,5) = 'GRADE' )
821: THEN
822: if g_debug then
823: hr_utility.set_location('gaz - num of segs is '||to_Char(hxc_resource_rules_utils.g_grade_num_of_segs), 999);
824: end if;
825: IF ( hxc_resource_rules_utils.g_grade_num_of_segs IS NULL )
826: THEN
827: OPEN csr_get_grade_segs;
832: CLOSE csr_get_grade_segs;
833:
834: END IF;
835: if g_debug then
836: hr_utility.set_location('gaz - num of segs is '||to_Char(hxc_resource_rules_utils.g_grade_num_of_segs), 999);
837: end if;
838:
839: -- get sequence
840:
842:
843: -- get value
844:
845: if g_debug then
846: hr_utility.set_location('gaz - params are ', 999);
847: hr_utility.set_location('gaz - p id_flex_num '||to_char(hxc_resource_rules_utils.g_grade_id_flex_num) , 999);
848: hr_utility.set_location('gaz - l sequence '||to_char(l_Sequence) , 999);
849: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_grade_num_of_segs) , 999);
850: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_grade_delimiter , 999);
843: -- get value
844:
845: if g_debug then
846: hr_utility.set_location('gaz - params are ', 999);
847: hr_utility.set_location('gaz - p id_flex_num '||to_char(hxc_resource_rules_utils.g_grade_id_flex_num) , 999);
848: hr_utility.set_location('gaz - l sequence '||to_char(l_Sequence) , 999);
849: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_grade_num_of_segs) , 999);
850: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_grade_delimiter , 999);
851: hr_utility.set_location('gaz - p type '||p_type , 999);
844:
845: if g_debug then
846: hr_utility.set_location('gaz - params are ', 999);
847: hr_utility.set_location('gaz - p id_flex_num '||to_char(hxc_resource_rules_utils.g_grade_id_flex_num) , 999);
848: hr_utility.set_location('gaz - l sequence '||to_char(l_Sequence) , 999);
849: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_grade_num_of_segs) , 999);
850: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_grade_delimiter , 999);
851: hr_utility.set_location('gaz - p type '||p_type , 999);
852: hr_utility.set_location('gaz - p value '||p_value , 999);
845: if g_debug then
846: hr_utility.set_location('gaz - params are ', 999);
847: hr_utility.set_location('gaz - p id_flex_num '||to_char(hxc_resource_rules_utils.g_grade_id_flex_num) , 999);
848: hr_utility.set_location('gaz - l sequence '||to_char(l_Sequence) , 999);
849: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_grade_num_of_segs) , 999);
850: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_grade_delimiter , 999);
851: hr_utility.set_location('gaz - p type '||p_type , 999);
852: hr_utility.set_location('gaz - p value '||p_value , 999);
853: end if;
846: hr_utility.set_location('gaz - params are ', 999);
847: hr_utility.set_location('gaz - p id_flex_num '||to_char(hxc_resource_rules_utils.g_grade_id_flex_num) , 999);
848: hr_utility.set_location('gaz - l sequence '||to_char(l_Sequence) , 999);
849: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_grade_num_of_segs) , 999);
850: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_grade_delimiter , 999);
851: hr_utility.set_location('gaz - p type '||p_type , 999);
852: hr_utility.set_location('gaz - p value '||p_value , 999);
853: end if;
854:
847: hr_utility.set_location('gaz - p id_flex_num '||to_char(hxc_resource_rules_utils.g_grade_id_flex_num) , 999);
848: hr_utility.set_location('gaz - l sequence '||to_char(l_Sequence) , 999);
849: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_grade_num_of_segs) , 999);
850: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_grade_delimiter , 999);
851: hr_utility.set_location('gaz - p type '||p_type , 999);
852: hr_utility.set_location('gaz - p value '||p_value , 999);
853: end if;
854:
855: FOR grade IN csr_get_grade_meaning (
848: hr_utility.set_location('gaz - l sequence '||to_char(l_Sequence) , 999);
849: hr_utility.set_location('gaz - p max sequence '||to_char(hxc_resource_rules_utils.g_grade_num_of_segs) , 999);
850: hr_utility.set_location('gaz - p delim '||hxc_resource_rules_utils.g_grade_delimiter , 999);
851: hr_utility.set_location('gaz - p type '||p_type , 999);
852: hr_utility.set_location('gaz - p value '||p_value , 999);
853: end if;
854:
855: FOR grade IN csr_get_grade_meaning (
856: p_id_flex_num => hxc_resource_rules_utils.g_grade_id_flex_num
864: IF grade.meaning is not null
865: THEN
866: l_meaning := grade.meaning;
867: if g_debug then
868: hr_utility.set_location('gaz - meaning is '||l_meaning, 999);
869: end if;
870: exit;
871: END IF;
872: