3296: CURSOR stu -- Selects all rows from startup entity
3297: IS
3298: select distinct name
3299: , legislation_code c_leg_code
3300: from hr_s_functions;
3301:
3302: CURSOR distinct_function(f_name IN varchar2, c_leg_code IN varchar2)
3303: IS
3304: -- Cursor to select distinct functions
3303: IS
3304: -- Cursor to select distinct functions
3305:
3306: select *
3307: from hr_s_functions
3308: where name = f_name
3309: and nvl(legislation_code, 'X') = nvl(c_leg_code, 'X');
3310:
3311: CURSOR usages(f_id IN number)
3366:
3367: delete from hr_s_function_context_usages a
3368: where exists
3369: (select null
3370: from hr_s_functions b
3371: where b.function_id = a.function_id
3372: and b.name = stu_rec.name
3373: and nvl(b.legislation_code,'X')=nvl(stu_rec.c_leg_code,'X')
3374: );
3375:
3376: delete from hr_s_function_parameters a
3377: where exists
3378: (select null
3379: from hr_s_functions b
3380: where b.function_id = a.function_id
3381: and b.name = stu_rec.name
3382: and nvl(b.legislation_code,'X')=nvl(stu_rec.c_leg_code,'X')
3383: );
3382: and nvl(b.legislation_code,'X')=nvl(stu_rec.c_leg_code,'X')
3383: );
3384:
3385:
3386: delete from hr_s_functions
3387: where name = stu_rec.name
3388: and nvl(legislation_code,'X')=nvl(stu_rec.c_leg_code,'X');
3389:
3390: ELSE