DBA Data[Home] [Help]

APPS.PQP_GB_SWF_ARCHIVE SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 123

procedure insert_archive_row(p_assactid       in number,
                             p_effective_date in date,
                             p_tab_rec_data   in action_info_table) is
     l_proc  constant varchar2(50):= g_package||'insert_archive_row';
Line: 181

end insert_archive_row;
Line: 191

  select  pcv_information1  ,
          pcv_information3  ,
          pcv_information4
  from    pqp_configuration_values pcv
  where   pcv.pcv_information_category = 'PQP_GB_SWF_TEACHER_NUM'
  and     pcv.business_group_id        = g_business_group_id;
Line: 199

  select  pcv_information1
  from    pqp_configuration_values pcv
  where   pcv.pcv_information_category = 'PQP_GB_SWF_QTS_SRC'
  and     pcv.business_group_id        = g_business_group_id;
Line: 205

  select  pcv_information1,
          pcv_information2
  from    pqp_configuration_values pcv
  where   pcv.pcv_information_category = 'PQP_GB_SWF_QTS_ROUTE_SRC'
  and     pcv.business_group_id        = g_business_group_id;
Line: 212

  select  pcv_information1,
          pcv_information4,
          decode(pcv_information1,'JOB',pcv_information3,   pcv_information5)
  from    pqp_configuration_values pcv
  where   pcv.pcv_information_category = 'PQP_GB_SWF_HLTA_STATUS_SRC'
  and     pcv.business_group_id        = g_business_group_id;
Line: 220

  select  pcv_information1,
          pcv_information3
  from    pqp_configuration_values pcv
  where   pcv.pcv_information_category = 'PQP_GB_SWF_POST_SOURCE'
  and     pcv.business_group_id        = g_business_group_id;
Line: 227

  select  pcv_information1,
          pcv_information2,
          pcv_information3
  from    pqp_configuration_values pcv
  where   pcv.pcv_information_category = 'PQP_GB_SWF_ORIGIN_SRC'
  and     pcv.business_group_id        = g_business_group_id;
Line: 235

  select  pcv_information1,
          pcv_information2,
          pcv_information3
  from    pqp_configuration_values pcv
  where   pcv.pcv_information_category = 'PQP_GB_SWF_DESTINATION_SRC' -- Check in database
  and     pcv.business_group_id        = g_business_group_id;
Line: 243

  select  pcv_information1,
          pcv_information3
  from    pqp_configuration_values pcv
  where   pcv.pcv_information_category = 'PQP_GB_SWF_ROLE_SOURCE'
  and     pcv.business_group_id        = g_business_group_id;
Line: 250

  select  pcv_information1,
          pcv_information2,
          pcv_information3
  from    pqp_configuration_values pcv
  where   pcv.pcv_information_category = 'PQP_GB_SWF_ADD_ROLE_SOURCE'
  and     pcv.business_group_id        = g_business_group_id;
Line: 300

             'select '||l_column||
             ' from per_all_people_f where ATTRIBUTE_CATEGORY = '''||l_context||'''
             and person_id = :person_id
             and :effective_date between effective_start_date and effective_end_date';
Line: 306

    g_teacher_sql_str :=  'select max('||l_column||')'||
             ' from per_people_extra_info where information_type = '''||l_context||'''
              and person_id = :person_id
              and '||l_column ||' is not null ';
Line: 325

          'select max(hr_general.decode_lookup(''YES_NO'',pcv.pcv_information4))
          from per_all_assignments_f paf,
            per_grades pgr,
            per_grade_definitions pgd ,
            pqp_configuration_values pcv
          where paf.business_group_id + 0 = :bg_id
          and paf.business_group_id       = pgr.business_group_id
          and pcv.business_group_id       = paf.business_group_id
          and pgr.grade_definition_id     = pgd.grade_definition_id
          and paf.grade_id                = pgr.grade_id
          and :eff_date between paf.effective_start_date and paf.effective_end_date
          and person_id                    = :person_id
          and pcv.pcv_information_category = ''PQP_GB_SWF_QTS_MAPPING''
          and ((pcv_information3          is null
          and pgd.'||l_qts_grade_seg_name||'                 = pcv.pcv_information2 )
          or (pcv_information3            is not null
          and pgd.'||l_qts_grade_seg_name||' between pcv.pcv_information2 and pcv_information3))';
Line: 355

      'select max(pcv.pcv_information4)
      from  per_all_assignments_f paf,
            per_grades pgr,
            per_grade_definitions pgd ,
            pqp_configuration_values pcv
      where paf.business_group_id + 0 = :bg_id
      and paf.business_group_id       = pgr.business_group_id
      and pcv.business_group_id       = paf.business_group_id
      and pgr.grade_definition_id     = pgd.grade_definition_id
      and paf.grade_id                = pgr.grade_id
      and :eff_date between paf.effective_start_date and paf.effective_end_date
      and person_id                    = :person_id
      and pcv.pcv_information_category = ''PQP_GB_SWF_QTS_ROUTE_MAPPING''
      and ((pcv_information3          is null
      and pgd.'||l_qts_route_seg_name||'                 = pcv.pcv_information2 )
      or (pcv_information3            is not null
      and pgd.'||l_qts_route_seg_name||' between pcv.pcv_information2 and pcv_information3))';
Line: 374

      'select max(pcv.pcv_information4) QT_status
      from  per_all_assignments_f paf,
            per_jobs job,
            per_job_definitions jobdef  ,
            pqp_configuration_values pcv
      where paf.business_group_id + 0 = :bg_id
      and paf.business_group_id = job.business_group_id
      and pcv.business_group_id = paf.business_group_id
      and job.job_definition_id = jobdef.job_definition_id
      and paf.job_id = job.job_id
      and :eff_date between paf.effective_start_date and paf.effective_end_date
      and person_id = :person_id
      and pcv.pcv_information_category = ''PQP_GB_SWF_QTS_ROUTE_MAPPING''
      and jobdef.'||l_qts_route_seg_name||' = pcv.pcv_information2';
Line: 390

      'select max(pcv.pcv_information4) QT_status
      from  per_all_assignments_f paf,
            per_positions pos,
            per_position_definitions posdef  ,
            pqp_configuration_values pcv
      where paf.business_group_id + 0 = :bg_id
      and paf.business_group_id = pos.business_group_id
      and pcv.business_group_id = paf.business_group_id
      and pos.position_definition_id = posdef.position_definition_id
      and paf.position_id = pos.position_id
      and :eff_date between paf.effective_start_date and paf.effective_end_date
      and person_id = :person_id
      and pcv.pcv_information_category = ''PQP_GB_SWF_QTS_ROUTE_MAPPING''
      and posdef.'||l_qts_route_seg_name||' = pcv.PCV_INFORMATION2';
Line: 412

      'select max(hr_general.decode_lookup(''YES_NO'',pcv.pcv_information3))
      from  per_all_assignments_f paf,
            per_jobs job,
            per_job_definitions jobdef  ,
            pqp_configuration_values pcv
      where paf.business_group_id + 0 = :bg_id
      and paf.business_group_id = job.business_group_id
      and pcv.business_group_id = paf.business_group_id
      and job.job_definition_id = jobdef.job_definition_id
      and paf.job_id = job.job_id
      and :eff_date between paf.effective_start_date and paf.effective_end_date
      and person_id = :person_id
      and pcv.pcv_information_category = ''PQP_GB_SWF_HLTA_STATUS_MAPPING''
      and jobdef.'||l_hlta_seg_name||' = pcv.pcv_information2';
Line: 429

   'select max(hr_general.decode_lookup(''YES_NO'',pcv.pcv_information3))
      from per_all_people_f pap,
           pqp_configuration_values pcv
      where attribute_category = '''||l_hlta_context_name||'''
     and pap.person_id = :person_id
     and :effective_date between pap.effective_start_date and pap.effective_end_date
     and pcv.business_group_id = pap.business_group_id
     and pcv.pcv_information_category = ''PQP_GB_SWF_HLTA_STATUS_MAPPING''
     and pap.'||l_hlta_seg_name||' = pcv.pcv_information2';
Line: 440

    'select max(hr_general.decode_lookup(''YES_NO'',pcv.pcv_information3))
      from per_all_assignments_f paf,
           pqp_configuration_values pcv
      where ass_attribute_category = '''||l_hlta_context_name||'''
     and paf.person_id = :person_id
     and :effective_date between paf.effective_start_date and paf.effective_end_date
     and pcv.business_group_id = paf.business_group_id
     and pcv.pcv_information_category = ''PQP_GB_SWF_HLTA_STATUS_MAPPING''
     and pap.'||l_hlta_seg_name||' = pcv.pcv_information2';
Line: 457

      'select pcv.pcv_information4
      from  per_all_assignments_f paf,
            per_grades pgr,
            per_grade_definitions pgd ,
            pqp_configuration_values pcv
      where paf.business_group_id + 0 = :bg_id
      and paf.business_group_id       = pgr.business_group_id
      and pcv.business_group_id       = paf.business_group_id
      and pgr.grade_definition_id     = pgd.grade_definition_id
      and paf.grade_id                = pgr.grade_id
      and :eff_date between paf.effective_start_date and paf.effective_end_date
      and paf.assignment_id                    = :assignment_id
      and pcv.pcv_information_category = ''PQP_GB_SWF_POST_MAPPING''
      and ((pcv_information3          is null
      and pgd.'||l_cont_post_seg||'                 = pcv.pcv_information2 )
      or (pcv_information3            is not null
      and pgd.'||l_cont_post_seg||' between pcv.pcv_information2 and pcv_information3))';
Line: 476

      'select pcv.pcv_information4
      from  per_all_assignments_f paf,
            per_jobs job,
            per_job_definitions jobdef  ,
            pqp_configuration_values pcv
      where paf.business_group_id + 0 = :bg_id
      and paf.business_group_id = job.business_group_id
      and pcv.business_group_id = paf.business_group_id
      and job.job_definition_id = jobdef.job_definition_id
      and paf.job_id = job.job_id
      and :eff_date between paf.effective_start_date and paf.effective_end_date
      and paf.assignment_id                    = :assignment_id
      and pcv.pcv_information_category = ''PQP_GB_SWF_POST_MAPPING''
      and jobdef.'||l_cont_post_seg||' = pcv.pcv_information2';
Line: 492

      'select pcv.pcv_information4
      from  per_all_assignments_f paf,
            per_positions pos,
            per_position_definitions posdef  ,
            pqp_configuration_values pcv
      where paf.business_group_id + 0 = :bg_id
      and paf.business_group_id = pos.business_group_id
      and pcv.business_group_id = paf.business_group_id
      and pos.position_definition_id = posdef.position_definition_id
      and paf.position_id = pos.position_id
      and :eff_date between paf.effective_start_date and paf.effective_end_date
      and paf.assignment_id                    = :assignment_id
      and pcv.pcv_information_category = ''PQP_GB_SWF_POST_MAPPING''
      and posdef.'||l_cont_post_seg||' = pcv.pcv_information2';
Line: 514

      'select '||l_origin_segment||'
      from per_all_assignments_f where ass_attribute_category = '''||l_origin_context||'''
      and assignment_id = :assignment_id
      and :effective_date between effective_start_date and effective_end_date';
Line: 520

      'select '||l_origin_segment||
      ' from per_all_people_f where ATTRIBUTE_CATEGORY = '''||l_origin_context||'''
      and person_id = :person_id
      and :effective_date between effective_start_date and effective_end_date';
Line: 532

      'select '||l_destination_segment||'
      from per_all_assignments_f where ass_attribute_category = '''||l_destination_context||'''
      and assignment_id = :assignment_id
      and :effective_date between effective_start_date and effective_end_date';
Line: 538

      'select '||l_destination_segment||
      ' from per_periods_of_service where ATTRIBUTE_CATEGORY = '''||l_destination_context||'''
      and person_id = :person_id';
Line: 549

      'select pcv.pcv_information4
      from  per_all_assignments_f paf,
            per_grades pgr,
            per_grade_definitions pgd ,
            pqp_configuration_values pcv
      where paf.business_group_id + 0 = :bg_id
      and paf.business_group_id       = pgr.business_group_id
      and pcv.business_group_id       = paf.business_group_id
      and pgr.grade_definition_id     = pgd.grade_definition_id
      and paf.grade_id                = pgr.grade_id
      and :eff_date between paf.effective_start_date and paf.effective_end_date
      and paf.assignment_id                    = :assignment_id
      and pcv.pcv_information_category = ''PQP_GB_SWF_ROLE_MAPPING''
      and ((pcv_information3          is null
      and pgd.'||l_role_segment||'                 = pcv.pcv_information2 )
      or (pcv_information3            is not null
      and pgd.'||l_role_segment||' between pcv.pcv_information2 and pcv_information3))';
Line: 568

      'select pcv.pcv_information4
      from  per_all_assignments_f paf,
            per_jobs job,
            per_job_definitions jobdef  ,
            pqp_configuration_values pcv
      where paf.business_group_id + 0 = :bg_id
      and paf.business_group_id = job.business_group_id
      and pcv.business_group_id = paf.business_group_id
      and job.job_definition_id = jobdef.job_definition_id
      and paf.job_id = job.job_id
      and :eff_date between paf.effective_start_date and paf.effective_end_date
      and paf.assignment_id                    = :assignment_id
      and pcv.pcv_information_category = ''PQP_GB_SWF_ROLE_MAPPING''
      and jobdef.'||l_role_segment||' = pcv.pcv_information2';
Line: 584

      'select pcv.pcv_information4
      from  per_all_assignments_f paf,
            per_positions pos,
            per_position_definitions posdef  ,
            pqp_configuration_values pcv
      where paf.business_group_id + 0 = :bg_id
      and paf.business_group_id = pos.business_group_id
      and pcv.business_group_id = paf.business_group_id
      and pos.position_definition_id = posdef.position_definition_id
      and paf.position_id = pos.position_id
      and :eff_date between paf.effective_start_date and paf.effective_end_date
      and paf.assignment_id                    = :assignment_id
      and pcv.pcv_information_category = ''PQP_GB_SWF_ROLE_MAPPING''
      and posdef.'||l_role_segment||' = pcv.pcv_information2';
Line: 606

    		'select pcv.pcv_information4
		from per_all_assignments_f paa,
		     per_position_extra_info pei,
		     pqp_configuration_values pcv
		where paa.assignment_id = :p_assignment_id
		and   pei.position_id = paa.position_id
		and   pei.information_type = '''||l_addl_role_context||'''
		and   pcv.pcv_information_category = ''PQP_GB_SWF_ROLE_MAPPING''
		and   paa.business_group_id = pcv.business_group_id
		and   pei.'||l_addl_role_segment||' = pcv.pcv_information2
		and   :effective_date between paa.effective_start_date and paa.effective_end_date';
Line: 619

       'select pcv.pcv_information4
		from per_all_assignments_f paa,
		     per_job_extra_info jei,
		     pqp_configuration_values pcv
		where paa.assignment_id = :p_assignment_id
		and   jei.job_id = paa.job_id
		and   jei.information_type = '''||l_addl_role_context||'''
		and   pcv.pcv_information_category = ''PQP_GB_SWF_ROLE_MAPPING''
		and   paa.business_group_id = pcv.business_group_id
		and   jei.'||l_addl_role_segment||' = pcv.pcv_information2
		and   :effective_date between paa.effective_start_date and paa.effective_end_date';
Line: 632

    		'select pcv.pcv_information4
		from   per_assignment_extra_info aei,
		       pqp_configuration_values pcv
		where  aei.assignment_id = :p_assignment_id
		and    aei.information_type = '''||l_addl_role_context||'''
		and    pcv.pcv_information_category = ''PQP_GB_SWF_ROLE_MAPPING''
        and    pcv.business_group_id = :bg_id
		and    aei.'||l_addl_role_segment||' = pcv.pcv_information2';
Line: 664

    insert into pay_message_lines(line_sequence,
                                  payroll_id,
                                  message_level,
                                  source_id,
                                  source_type,
                                  line_text)
                           values(
                                  pay_message_lines_s.nextval
                                 ,null
                                 ,p_message_level
                                 ,assignment_action_id
                                 ,'A'
                                 ,substr(p_message_text,1,240)
                                );
Line: 703

  sqlstr := 'select distinct person_id '
            ||'from per_all_people_f ppf, '
            ||'pay_payroll_actions ppa '
            ||'where ppa.payroll_action_id = :payroll_action_id '
            ||'and ppa.business_group_id = ppf.business_group_id '
            ||'order by ppf.person_id';
Line: 724

    sqlstr := 'select 1 from dual where to_char(:payroll_action_id) = dummy';
Line: 736

  select assignment_action_id
  from pay_assignment_actions
  where payroll_action_id = p_pactid
  and assignment_id = p_assignment_id;
Line: 767

     select min(assignment_action_id)
     from pay_assignment_actions
     where assignment_id in (select assignment_id
                             from  per_all_assignments_f
                             where person_id = p_person_id)
     and  payroll_action_id = p_pactid;
Line: 803

  select(pay_gb_eoy_archive.get_parameter(legislative_parameters,'CENSUS_YEAR')) census_year,
  (pay_gb_eoy_archive.get_parameter(legislative_parameters,'CENSUS_DAY')) census_day,
  add_months(to_date((pay_gb_eoy_archive.get_parameter(legislative_parameters,'CONT_ST_DAY'))),-12) cont_st_day,
  (pay_gb_eoy_archive.get_parameter(legislative_parameters,'CONT_END_DAY')) cont_end_day,
  (pay_gb_eoy_archive.get_parameter(legislative_parameters,'LEA_NUM')) lea_num,
  upper((pay_gb_eoy_archive.get_parameter(legislative_parameters,'DATA_RETURN_TYPE'))) data_return_type,
  (pay_gb_eoy_archive.get_parameter(legislative_parameters,'ESTB_NUM')) estb_num,
  (pay_gb_eoy_archive.get_parameter(legislative_parameters,'EXCLUDE_ABS')) exclude_abs,
  (pay_gb_eoy_archive.get_parameter(legislative_parameters,'EXCLUDE_QUAL')) exclude_qual,
  (pay_gb_eoy_archive.get_parameter(legislative_parameters,'ASG_SET')) asg_set,
  effective_date,
  business_group_id
  from   pay_payroll_actions
  where  payroll_action_id = pactid;
Line: 821

  select distinct asg.assignment_id,
                  asg.person_id
  from   per_all_assignments_f asg,
         hr_location_extra_info hlei,
         per_people_extra_info pei,
         (select  distinct min(asg1.effective_start_date) over( partition by assignment_id) effective_start_date,
            max(asg1.effective_end_date) over( partition by assignment_id)  effective_end_date,
            first_value(location_id)over( partition by assignment_id order by asg1.effective_end_date desc ) location_id,
            asg1.assignment_id
          from per_all_assignments_f asg1,
               per_assignment_status_types pas
          where asg1.assignment_status_type_id = pas.assignment_status_type_id
          and   pas.per_system_status = 'ACTIVE_ASSIGN') min_max
  where  asg.person_id between stperson and endperson
  and asg.business_group_id + 0 = g_business_group_id
  and min_max.location_id = hlei.location_id
  and hlei.information_type = 'PQP_GB_EDU_ESTB_INFO'
  and hlei.lei_information6 = g_lea_number
  and (g_estb_number is null
       or hlei.lei_information2 = g_estb_number)
  and pei.person_id = asg.person_id

  and pei.information_type = 'PQP_SCHOOL_WORKFORCE_CENSUS'
  and pei.pei_information5 <> 'OTHER'

  and min_max.assignment_id = asg.assignment_id

  and (min_max.effective_end_date between g_cont_data_st_date and g_cont_data_end_date -- contract change or the contract is terminated

	or  (g_census_day between min_max.effective_start_date and min_max.effective_end_date
	    ) -- Check for snapshot data

	or  (g_exclude_absence = 'No'                                                   -- Check absence existance only if it is not excluded
            and exists (select 1 -- If an absence exists in the previous calander year
                        from   per_absence_attendances abs
                        where  abs.person_id = asg.person_id
                        and abs.business_group_id = asg.business_group_id
                        and (abs.date_end between g_cont_data_st_date and g_cont_data_end_date
                              or abs.date_start between g_cont_data_st_date and g_cont_data_end_date))
	    )
	or  (g_exclude_qual = 'No' -- Qualification present or not?
            and g_census_day between min_max.effective_start_date and min_max.effective_end_date   -- check if contract is still
            and exists (select 1 from per_qualifications qual                              -- valid only if qual data is included
                      where qual.person_id = asg.person_id )
            )
	)

  -- 28 Days Condition
  and decode(min_max.effective_end_date,hr_general.end_of_time,to_date(g_census_day),min_max.effective_end_date)-
                     min_max.effective_start_date >= 28
  -- 28 Days Condition

  and (g_data_ret_type <> 'TYPE3'
       or (g_data_ret_type = 'TYPE3' and pei.pei_information5 = 'CENTRAL_STAFF'))

  and (p_asg_set_id is null -- don't check for assignment set in this case
        or exists (select 1
                   from   hr_assignment_sets has1
                   where  has1.assignment_set_id = p_asg_set_id
                   and has1.business_group_id = asg.business_group_id
                   and nvl(has1.payroll_id,asg.payroll_id) = asg.payroll_id
                   and (not exists (select 1 -- chk no amendments
                                    from   hr_assignment_set_amendments hasa1
                                    where  hasa1.assignment_set_id = has1.assignment_set_id)
                         or exists (select 1 -- chk include amendments
                                    from   hr_assignment_set_amendments hasa2
                                    where  hasa2.assignment_set_id = has1.assignment_set_id
                                    and hasa2.assignment_id = asg.assignment_id
                                    and nvl(hasa2.include_or_exclude,'I') = 'I')
                         or (not exists (select 1 --chk no exlude amendments
                                         from   hr_assignment_set_amendments hasa3
                                         where  hasa3.assignment_set_id = has1.assignment_set_id
                                         and hasa3.assignment_id = asg.assignment_id
                                         and nvl(hasa3.include_or_exclude,'I') = 'E')
                             and not exists (select 1 --and chk no Inc amendments
                                             from   hr_assignment_set_amendments hasa4
                                             where  hasa4.assignment_set_id = has1.assignment_set_id
                                             and nvl(hasa4.include_or_exclude,'I') = 'I')
                            ) -- end checking exclude amendments
                       ) -- done checking amendments
                  ) -- done asg set check when not null
      ); -- end of asg set check
Line: 907

  select distinct asg.assignment_id,asg.person_id
  from   per_all_assignments_f asg,
         pqp_assignment_attributes_f att,
         hr_location_extra_info hlei,
         per_people_extra_info pei,
         (select min(att1.effective_start_date) effective_start_date,
                 max(att1.effective_end_date) effective_end_date,
                 att1.assignment_id
          from  pqp_assignment_attributes_f att1
          group by assignment_id ) min_max,

          (select    first_value(location_id)over( partition by assignment_id order by asg1.effective_end_date desc ) location_id,
          asg1.assignment_id
          from per_all_assignments_f asg1,
               per_assignment_status_types pas
          where asg1.assignment_status_type_id = pas.assignment_status_type_id
          and   pas.per_system_status = 'ACTIVE_ASSIGN') loc
  where  asg.person_id between stperson and endperson
  and asg.business_group_id + 0 = g_business_group_id
  and att.business_group_id = asg.business_group_id
  and asg.assignment_id = att.assignment_id
  and loc.assignment_id = asg.assignment_id
  and loc.location_id = hlei.location_id
  and hlei.information_type = 'PQP_GB_EDU_ESTB_INFO'
  and hlei.lei_information6 = g_lea_number
  and (g_estb_number is null
       or hlei.lei_information2 = g_estb_number)
  and pei.person_id = asg.person_id

  and pei.pei_information5 <> 'OTHER'
  and pei.information_type = 'PQP_SCHOOL_WORKFORCE_CENSUS'

  and min_max.assignment_id = asg.assignment_id

  and (min_max.effective_end_date between g_cont_data_st_date and g_cont_data_end_date -- contract change or the contract is terminated

	or  (g_census_day between min_max.effective_start_date and min_max.effective_end_date
	    ) -- Check for snapshot data only

	or  (g_exclude_absence = 'No' -- Check absence existance only if it is not excluded
            and exists (select 1 -- If an absence exists in the previous calander year
                        from   per_absence_attendances abs
                        where  abs.person_id = asg.person_id
                        and abs.business_group_id = asg.business_group_id
                        and (abs.date_end between g_cont_data_st_date and g_cont_data_end_date
                              or abs.date_start between g_cont_data_st_date and g_cont_data_end_date))
	    )

      	or  (g_exclude_qual = 'No' -- Qualification present or not?
            and g_census_day between min_max.effective_start_date and min_max.effective_end_date   -- check if contract is still
            and exists (select 1 from per_qualifications qual                              -- valid only if qual data is included
                      where qual.person_id = asg.person_id )
            )

      )

  -- 28 Days Condition
  and decode(min_max.effective_end_date,hr_general.end_of_time,to_date(g_census_day),min_max.effective_end_date)-
                     min_max.effective_start_date >= 28
  -- 28 Days Condition

  and (g_data_ret_type <> 'TYPE3'
       or (g_data_ret_type = 'TYPE3' and pei.pei_information5 = 'CENTRAL_STAFF'))

  and (p_asg_set_id is null -- don't check for assignment set in this case
        or exists (select 1
                   from   hr_assignment_sets has1
                   where  has1.assignment_set_id = p_asg_set_id
                   and has1.business_group_id = asg.business_group_id
                   and nvl(has1.payroll_id,asg.payroll_id) = asg.payroll_id
                   and (not exists (select 1 -- chk no amendments
                                    from   hr_assignment_set_amendments hasa1
                                    where  hasa1.assignment_set_id = has1.assignment_set_id)
                         or exists (select 1 -- chk include amendments
                                    from   hr_assignment_set_amendments hasa2
                                    where  hasa2.assignment_set_id = has1.assignment_set_id
                                    and hasa2.assignment_id = asg.assignment_id
                                    and nvl(hasa2.include_or_exclude,'I') = 'I')
                         or (not exists (select 1 --chk no exlude amendments
                                         from   hr_assignment_set_amendments hasa3
                                         where  hasa3.assignment_set_id = has1.assignment_set_id
                                         and hasa3.assignment_id = asg.assignment_id
                                         and nvl(hasa3.include_or_exclude,'I') = 'E')
                             and not exists (select 1 --and chk no Inc amendments
                                             from   hr_assignment_set_amendments hasa4
                                             where  hasa4.assignment_set_id = has1.assignment_set_id
                                             and nvl(hasa4.include_or_exclude,'I') = 'I')
                            ) -- end checking exclude amendments
                       ) -- done checking amendments
                  ) -- done asg set check when not null
      ); -- end of asg set check
Line: 1001

  select distinct pcv_information1
  from   pqp_configuration_values
  where  pcv_information_category = 'PQP_GB_SWF_CONTRACT_TYPE'
  and    business_group_id        = g_business_group_id;
Line: 1075

              select pay_assignment_actions_s.nextval
              into   l_ass_act_id
              from   dual;
Line: 1096

              select pay_assignment_actions_s.nextval
              into   l_ass_act_id
              from   dual;
Line: 1119

  select  membership_number
  from    per_qualifications
  where   person_id = p_person_id
  and     membership_number is not null;
Line: 1184

  select pcv_information2
  from   pqp_configuration_values
  where  pcv_information_category = p_context_name
  and    pcv_information1 = p_value
  and    business_group_id = g_business_group_id;
Line: 1210

  select /*+ ORDERED */
          pap.person_id,
          pap.employee_number,
          paa.assignment_id,
          pap.first_name,
          pap.last_name ,
          paa.assignment_number,
          pap.national_identifier,
          decode(pap.sex,'M','1','F','2','9') sex,
          pap.previous_last_name,
					per_information1 ethnic_code,
          pap.date_of_birth date_of_birth,
					to_char(pap.date_of_birth,'YYYY-MM-DD') dob_dcsf
  from    pay_assignment_actions act,
          per_all_assignments_f      paa,
          per_all_people_f           pap
  where  act.assignment_action_id = p_assactid
  and    act.assignment_id = paa.assignment_id
  and    paa.person_id = pap.person_id
  and    csr_effective_date between paa.effective_start_date and paa.effective_end_date
  and    csr_effective_date between pap.effective_start_date and pap.effective_end_date;
Line: 1233

  select  hr_general.decode_lookup('YES_NO',pei_information1 ) qt_sts,
          fnd_date.canonical_to_date(pei_information2)  qt_status_date,
          pei_information3  qts_route,
          pei_information4  teacher_number,
          pei_information5  workforce_inc_typ,
          hr_general.decode_lookup('YES_NO',pei_information9)  hlta_sts,
          pei_information10 origin
  from    per_people_extra_info pei
  where   pei.information_type = 'PQP_SCHOOL_WORKFORCE_CENSUS'
  and     pei.person_id        = p_person_id;
Line: 1245

  select 'YES'
  from   per_disabilities_f pdf
  where  pdf.person_id = p_person_id
  and    csr_effective_date between pdf.effective_start_date and pdf.effective_end_date;
Line: 1251

  select max(effective_end_date)
  from   pay_assignment_actions act,
         per_all_assignments_f      paa,
         per_assignment_status_types pas
  where  act.assignment_action_id = p_assactid
  and    act.assignment_id = paa.assignment_id
  and    paa.assignment_status_type_id = pas.assignment_status_type_id
  and   pas.per_system_status = 'ACTIVE_ASSIGN';
Line: 1261

  select max(effective_end_date)
  from   pay_assignment_actions act,
         pqp_assignment_attributes_f    att
  where  act.assignment_action_id = p_assactid
  and    act.assignment_id = att.assignment_id;
Line: 1268

  select ppf.person_id,ppf.employee_number
  from   pay_assignment_actions act,
         per_all_assignments_f      paa,
         per_all_people_f       ppf
  where  act.assignment_action_id = p_assactid
  and    act.assignment_id = paa.assignment_id
  and    ppf.person_id     = paa.person_id
  and    p_effective_date between paa.effective_start_date and paa.effective_end_date
  and    p_effective_date between ppf.effective_start_date and ppf.effective_end_date;
Line: 1279

  select hlei.lei_information2
  from   per_all_assignments_f asg,
         hr_location_extra_info hlei
  where asg.business_group_id + 0 = g_business_group_id
  and   asg.location_id = hlei.location_id
  and   asg.assignment_id = p_assignment_id
  and   p_effective_date between asg.effective_start_date and asg.effective_end_date
  and   asg.location_id = hlei.location_id
  and   hlei.information_type = 'PQP_GB_EDU_ESTB_INFO'
  and   hlei.lei_information6 = g_lea_number;
Line: 1570

			select	 'Y'
				into	 l_valid_ethnic_code
				from	 dual
			 where	 exists
				 (select lookup_code
				  from	 hr_lookups hl
				  where	 hl.lookup_type = 'UK_ETHNIC_CODES'
						 and hl.enabled_flag = 'Y'
						 and hl.lookup_code = l_staff_rec.ethnic_code);
Line: 1630

			select	 'Y'
			into	 l_valid_ethnic_code
			from	 dual
			where	 exists(select	lookup_code
				from	hr_lookups hl
				where	hl.lookup_type = 'PQP_GB_SWF_QTS_ROUTES'
				and     hl.enabled_flag = 'Y'
				and     hl.lookup_code = l_qts_route);
Line: 1704

  select ff.formula_id,ff.formula_name
    from ff_formulas_f ff
   where ff.formula_id        = p_formula_id
     and ff.business_group_id  = p_business_group_id
     and p_effective_date       between ff.effective_start_date and ff.effective_end_date;
Line: 1790

  select ff.formula_id,ff.formula_name
    from ff_formulas_f ff
   where ff.formula_name       = 'GB_CALCULATE_FTE_USING_PQP_CONTRACT_TYPES'
     and ff.legislation_code  = 'GB'
     and p_effective_date       between ff.effective_start_date and ff.effective_end_date;
Line: 1888

        select pexi.eei_information1,to_char(nvl(sum(prrv.result_value),0),'fm999999.00')
        bulk collect into p_addl_payments
        from per_all_assignments_f       paf,
             pay_element_entries_f       pee,
             pay_element_type_extra_info pexi,
             pay_run_results             prr,
             pay_input_values_f          piv,
             pay_run_result_values       prrv,
             pay_assignment_actions   assact,
      	   pay_payroll_actions      pact,
      	   per_time_periods         pptp
       where paf.assignment_id = p_assignment_id
         and paf.assignment_id = pee.assignment_id
         and pee.element_type_id =  pexi.element_type_id
         and pexi.information_type = 'PQP_SWFC_ADDITIONAL_PAYMNT_CAT'
         and pexi.element_type_id = prr.element_type_id
         and prr.assignment_action_id = assact.assignment_action_id
         and assact.payroll_action_id = pact.payroll_action_id
         and pact.time_period_id  = pptp.time_period_id
         and pptp.regular_payment_date between add_months(trunc(g_census_day),-12) and trunc(g_census_day)-1
         and prr.run_result_id = prrv.run_result_id
         and prr.status in ('P','PA')
         and prrv.input_value_id = piv.input_value_id
         and piv.element_type_id = pexi.element_type_id
         and piv.name = 'Pay Value'
         and p_effective_date between paf.effective_start_date and paf.effective_end_date
         and p_effective_date between pee.effective_start_date and pee.effective_end_date
         and p_effective_date between piv.effective_start_date and piv.effective_end_date
         group by pexi.eei_information1;
Line: 1941

  select paa.assignment_number   assignment_number,
       paa.employee_category   employee_cat,
       paa.employment_category assignment_cat
  from per_all_assignments_f paa
 where paa.assignment_id = p_assignment_id
   and p_effective_date between paa.effective_start_date and paa.effective_end_date;
Line: 1949

   select pcv_information4
     from pqp_configuration_values
    where business_group_id = g_business_group_id
      and pcv_information_category = 'PQP_GB_SWF_ROLE_MAPPING'
      and pcv_information2 = p_role;
Line: 2033

  select pcv_information1 hrs_source
  from   pqp_configuration_values pcv
  where  pcv.pcv_information_category = 'PQP_GB_SWF_HOURS'
  and    pcv.business_group_id = g_business_group_id;
Line: 2039

  select pcv_information1 hrs_source,
         pcv_information2 contract_type,
         pcv_information3 hrs_per_wk_formula,
         pcv_information4 wks_per_yr_source,
         pcv_information5 wks_per_yr_formula,
         pcv_information6 wks_per_yr_column
  from   pqp_configuration_values pcv
  where  pcv.pcv_information_category = 'PQP_GB_SWF_HOURS'
  and    nvl(pcv.pcv_information2,p_contract_type)  = p_contract_type
  and    pcv.business_group_id = g_business_group_id;
Line: 2051

  select pcv_information8 default_weeks_per_yr
  from   pqp_configuration_values pcv
  where  pcv.pcv_information_category = 'PQP_GB_SWF_HOURS'
  and    pcv.pcv_information7  = decode(p_staff_cat,1,'REGULAR_TEACHER',2,'AGENCY_TEACHER',3,'TEACHING_ASSISTANT',4,'OTHER_SUPPORT_STAFF')
  and    pcv.business_group_id = g_business_group_id;
Line: 2058

    select att.contract_type,work_pattern
    from   per_all_assignments_f paa,
           pqp_assignment_attributes_f att
    where  paa.assignment_id = p_assignment_id
    and    paa.assignment_id = att.assignment_id
    and    p_effective_date between att.effective_start_date and att.effective_end_date
    and    p_effective_date between paa.effective_start_date and paa.effective_end_date;
Line: 2067

   select  paa.assignment_number,paa.person_id,paa.frequency,paa.normal_hours
    from   per_all_assignments_f paa
    where  paa.assignment_id = p_assignment_id
    and    p_effective_date between paa.effective_start_date and paa.effective_end_date;
Line: 2073

  select val.value
  from pay_user_tables tab,
       pay_user_columns col,
       pay_user_rows_f r,
       pay_user_column_instances_f val
  where tab.user_table_name = 'PQP_COMPANY_WORK_PATTERNS'
  and tab.user_table_id=col.user_table_id
  and tab.user_table_id=r.user_table_id
  and col.user_column_id=val.user_column_id
  and r.user_row_id= val.user_row_id
  and col.user_column_name    = p_work_pattern
  and r.row_low_range_or_name = 'Number of Working Days'
  and g_census_day between r.effective_start_date and r.effective_end_date
  and g_census_day between val.effective_start_date and val.effective_end_date;
Line: 2090

  select val.value
  from pay_user_tables tab,
       pay_user_columns col,
       pay_user_rows_f r,
       pay_user_column_instances_f val
  where tab.user_table_name = 'PQP_CONTRACT_TYPES'
  and tab.business_group_id = g_business_group_id
  and tab.user_table_id=col.user_table_id
  and tab.user_table_id=r.user_table_id
  and col.user_column_id=val.user_column_id
  and r.user_row_id= val.user_row_id
  and col.user_column_id    = p_column_no
  and r.row_low_range_or_name = p_contract_type
  and g_census_day between r.effective_start_date and r.effective_end_date
  and g_census_day between val.effective_start_date and val.effective_end_date;
Line: 2107

  select pcv_information1,pcv_information2
  from   pqp_configuration_values pcv
  where  pcv.pcv_information_category = 'PQP_GB_SWF_FTE_HOURS'
  and    pcv.business_group_id = g_business_group_id;
Line: 2113

  select value
  from    per_assignment_budget_values_f
  where   assignment_id = p_assignment_id
  and     unit = 'HOURS'
  and     p_effective_date between effective_end_date and effective_start_date;
Line: 2448

select pcv_information1
from   pqp_configuration_values pcv
where  pcv.pcv_information_category = 'PQP_GB_SWF_ABSENCE_CODE'
and    pcv.business_group_id = g_business_group_id;
Line: 2476

      select paat.person_id,
             paat.date_start,
             to_char(paat.date_start,'YYYY-MM-DD'),
             paat.date_end,
             to_char(paat.date_end,'YYYY-MM-DD'),
             to_char(paat.absence_days,'fm999.0'),
             pcv.pcv_information5 absence_category,
             p_estab_no
        bulk collect into p_abs_tab
        from per_absence_attendances      paat,
             per_absence_attendance_types paatt,
             pqp_configuration_values     pcv
       where paat.absence_attendance_type_id = paatt.absence_attendance_type_id
         and paat.person_id = p_person_id
         and pcv.pcv_information_category = 'PQP_GB_SWF_ABSENCE_CODE'
         and pcv_information1 = 'ABSENCE_CATEGORY'
         and pcv.business_group_id = g_business_group_id
         and pcv_information3 = paatt.absence_category
         and (paat.date_end between g_cont_data_st_date and g_cont_data_end_date or
             paat.date_start between g_cont_data_st_date and g_cont_data_end_date)
	     order by paat.date_start asc;
Line: 2506

      select paat.person_id,
            paat.date_start,
            to_char(paat.date_start,'YYYY-MM-DD'),
            paat.date_end,
            to_char(paat.date_end,'YYYY-MM-DD'),
            to_char(paat.absence_days,'fm999.0'),
            pcv.pcv_information5 absence_type,
            p_estab_no
      bulk collect into p_abs_tab
       from per_absence_attendances      paat,
            pqp_configuration_values     pcv
      where paat.person_id = p_person_id
        and pcv.pcv_information_category = 'PQP_GB_SWF_ABSENCE_CODE'
        and pcv_information1 = 'ABSENCE_TYPE'
        and pcv.business_group_id = g_business_group_id
        and pcv_information4 = paat.absence_attendance_type_id
        and (paat.date_end between g_cont_data_st_date and g_cont_data_end_date or
            paat.date_start between g_cont_data_st_date and g_cont_data_end_date)
	    order by paat.date_start asc;
Line: 2534

      select paat.person_id,
             paat.date_start,
             to_char(paat.date_start,'YYYY-MM-DD'),
             paat.date_end,
             to_char(paat.date_end,'YYYY-MM-DD'),
             to_char(paat.absence_days,'fm999.0'),
             pcv.pcv_information5 absence_reason,
             p_estab_no
        bulk collect into p_abs_tab
        from per_absence_attendances        paat,
             per_abs_attendance_reasons paatr,
             pqp_configuration_values       pcv
       where paatr.abs_attendance_reason_id = paat.abs_attendance_reason_id
         and paat.person_id = p_person_id
         and pcv.pcv_information_category = 'PQP_GB_SWF_ABSENCE_CODE'
         and pcv_information1 = 'ABSENCE_REASON'
         and pcv.business_group_id = g_business_group_id
         and pcv_information3 = paatr.name
         and (paat.date_end between g_cont_data_st_date and g_cont_data_end_date or
             paat.date_start between g_cont_data_st_date and g_cont_data_end_date)
	     order by paat.date_start asc;
Line: 2693

  select paa.assignment_id          assignment_id,
         paa.assignment_number      assignment_number,
         paa.employment_category    contract_agg_type,
         paa.employee_category      employee_cat,
         paa.employment_category    assignment_cat
  from   pay_assignment_actions act,
         per_all_assignments_f      paa
  where  act.assignment_action_id = p_assactid
  and    act.assignment_id = paa.assignment_id
  and    p_effective_date between paa.effective_start_date and paa.effective_end_date;
Line: 2705

  select min(paa.effective_start_date) contract_st_date,
         max(paa.effective_end_date)  contract_end_date,
		 to_char(min(paa.effective_start_date),'YYYY-MM-DD') contract_st_date_dcsf,
         decode(to_char(max(paa.effective_end_date) ,'YYYY-MM-DD'),'4712-12-31',null,
				  to_char(max(paa.effective_end_date) ,'YYYY-MM-DD'))contract_end_date_dcsf,
         to_char(min(paa.effective_start_date) ,'YYYY-MM-DD') date_of_arrival_dcsf
  from   per_all_assignments_f      paa,
         per_assignment_status_types pas
  where  paa.assignment_status_type_id = pas.assignment_status_type_id
  and    pas.per_system_status = 'ACTIVE_ASSIGN'
  and    paa.assignment_id = p_assignment_id;
Line: 2718

  select paa.assignment_id          assignment_id,
         paa.assignment_number      assignment_number,
         att.contract_type          contract_agg_type,
         paa.employee_category      employee_cat,
         paa.employment_category    assignment_cat
  from   per_all_assignments_f paa,
         pay_assignment_actions act,
         pqp_assignment_attributes_f att
  where  act.assignment_action_id = p_assactid
  and    act.assignment_id = att.assignment_id
  and    paa.assignment_id = att.assignment_id
  and    p_effective_date between att.effective_start_date and att.effective_end_date
  and    p_effective_date between paa.effective_start_date and paa.effective_end_date;
Line: 2734

  select min(att.effective_start_date)  contract_st_date,
         max(att.effective_end_date)  contract_end_date,
				 to_char(min(att.effective_start_date) ,'YYYY-MM-DD') contract_st_date_dcsf,
         decode(to_char(max(att.effective_end_date) ,'YYYY-MM-DD'),'4712-12-31',null,
				  to_char(max(att.effective_end_date) ,'YYYY-MM-DD'))contract_end_date_dcsf,
		to_char(min(paa.effective_start_date) ,'YYYY-MM-DD') date_of_arrival_dcsf
   from  pqp_assignment_attributes_f att,
         per_all_assignments_f paa
  where  att.assignment_id = p_assignment_id
    and  paa.assignment_id = att.assignment_id;
Line: 2746

  select pcv_information1, pcv_information2
  from   pqp_configuration_values
  where  business_group_id = g_business_group_id
  and    pcv_information_category = 'PQP_GB_SWF_CNTRT_ARRIVAL_DATE';
Line: 2752

  select  pcv_information4
  from    pqp_configuration_values pcv
  where   pcv.pcv_information_category = 'PQP_GB_SWF_POST_MAPPING'
  and     pcv_information2             = p_emp_or_asgcat
  and     pcv.business_group_id        = g_business_group_id;
Line: 2759

  select  pcv_information3
  from    pqp_configuration_values pcv
  where   pcv.pcv_information_category = 'PQP_GB_SWF_ORIGIN_MAPPING'
  and     pcv_information2             = l_origin
  and     pcv.business_group_id        = g_business_group_id;
Line: 2766

  select  pcv_information3
  from    pqp_configuration_values pcv
  where   pcv.pcv_information_category = 'PQP_GB_SWF_DESTINATION_MAPPING'
  and     pcv_information2             = l_destination
  and     pcv.business_group_id        = g_business_group_id;
Line: 2773

  select aei_information1
  from   per_assignment_extra_info
  where  aei_information_category = 'PQP_SCHOOL_WORKFORCE_CENSUS'
  and    assignment_id = p_assignment_id;
Line: 2779

  select  decode(pei_information5,'CENTRAL_STAFF','L','SCHOOL_STAFF','S',null)  workforce_inc_typ          --- which can be archived
  from    per_people_extra_info pei
  where   pei.information_type = 'PQP_SCHOOL_WORKFORCE_CENSUS'
  and     pei.person_id        = p_person_id;
Line: 2785

  select  pcv_information5
  from    pqp_configuration_values pcv
  where   pcv.pcv_information_category = 'PQP_GB_SWF_CONTRACT_TYPE'
  and     pcv_information4             = p_pqp_cont_type
  and     pcv.business_group_id        = g_business_group_id;
Line: 2792

  select  pcv_information5
  from    pqp_configuration_values pcv
  where   pcv.pcv_information_category = 'PQP_GB_SWF_CONTRACT_TYPE'
  and     pcv_information3             = p_cont_type
  and     pcv.business_group_id        = g_business_group_id;
Line: 2987

				select	 'Y'
					into	 l_valid_flag
					from	 dual
				 where	 exists(select	 lookup_code
						from	 hr_lookups hl
						where			 hl.lookup_type = 'PQP_GB_SWF_CNTRCT_AGRMNT_TYPES'
						and hl.enabled_flag = 'Y'
						and hl.lookup_code = l_contract_agg_type);
Line: 3042

		-- 4361, 4362 Deleted

		-- 4370 already handled in select

		-- 4375
		/*if g_census_term <> 'SPRING' then -- Added as PRM and other contract types can exist in the system without end date
			if l_contract_agg_type <> 'FXT' and (l_asg_dates_rec.contract_end_date > g_census_day
			or months_between(l_asg_dates_rec.contract_end_date ,l_asg_dates_rec.contract_st_date) < 1) then
					l_arch := false;
Line: 3284

					select	 'Y'
					into	 l_valid_flag
			    from	 dual
					where	 exists
					 (select lookup_code
						from	 hr_lookups hl
						where	 hl.lookup_type = 'PQP_GB_SWF_DESTINATION_CODES'
						and    hl.enabled_flag = 'Y'
						and    hl.lookup_code = l_dcsf_destination);
Line: 3311

					select	 'Y'
					into	 l_valid_flag
					from	 dual
					where	 exists
					 (select	 lookup_code
							from	 hr_lookups hl
						 where	 hl.lookup_type = 'PQP_GB_SWF_ORIGIN_CODES'
							 and   hl.enabled_flag = 'Y'
							 and   hl.lookup_code = l_dcsf_origin);
Line: 3388

  select qual.qualification_id qual_id,
         qualtyp.qualification_type_id qualification_type_id,
         qualtyp.category qual_cat,
         decode(qua_information_category, 'GB', qua_information1, null) qual_code_dff,
         decode(qua_information_category, 'GB', qua_information2, null) subject1_dff,
         decode(qua_information_category, 'GB', qua_information3, null) subject2_dff,
         decode(qua_information_category, 'GB', decode(qua_information4,'Y','true','false'), null) verified_dff
    from per_qualifications qual, per_qualification_types qualtyp
   where qual.person_id = p_person_id
     and qual.qualification_type_id = qualtyp.qualification_type_id;
Line: 3400

  select max(decode(seq, 1, subject_dcsf, null)) subject_1,
         max(decode(seq, 2, subject_dcsf, null)) subject_2
  from (select subject_dcsf, seq
          from (select pcv.pcv_information2 subject_dcsf, row_number() over(order by major desc) seq
                  from per_qualifications qual, per_subjects_taken sub,
                       pqp_configuration_values pcv
                 where qual.qualification_id = sub.qualification_id
                   and qual.person_id = p_person_id
                   and qual.qualification_id = p_qual_id
                   and pcv.pcv_information_category = 'PQP_GB_SWF_QUAL_SUBJECT_MAP'
                   and pcv.pcv_information1 = sub.subject
                   and pcv.business_group_id = g_business_group_id)
         where seq < 3);
Line: 3415

  select pcv_information1
    from pqp_configuration_values pcv
   where pcv.pcv_information_category = 'PQP_GB_SWF_QUAL_CODE_MAP'
     and pcv.business_group_id = g_business_group_id;
Line: 3421

   select pcv_information5
    from pqp_configuration_values pcv
   where pcv.pcv_information_category = 'PQP_GB_SWF_QUAL_CODE_MAP'
     and pcv.pcv_information3  = p_qual_cat
     and pcv.business_group_id = g_business_group_id;
Line: 3428

   select pcv_information5
    from pqp_configuration_values pcv
   where pcv.pcv_information_category = 'PQP_GB_SWF_QUAL_CODE_MAP'
     and pcv.pcv_information4  = p_qual_typ
     and pcv.business_group_id = g_business_group_id;
Line: 3600

  select ps.parent_spine_id
    from per_grade_spines_f     grs,
         per_grades             gdt,
         per_parent_spines      ps,
         per_all_assignments_f  asg
   where grs.grade_id = gdt.grade_id
     and grs.parent_spine_id = ps.parent_spine_id
     and asg.grade_id =  grs.grade_id
     and asg.assignment_id = p_assignment_id
     and p_effective_date between asg.effective_start_date and asg.effective_end_date
     and p_effective_date between grs.effective_start_date and grs.effective_end_date;
Line: 3613

  select pcv.pcv_information2
    from pqp_configuration_values pcv
   where pcv.pcv_information_category = 'PQP_GB_SWF_PAY_SCALE_MAPPING'
     and pcv.pcv_information1  = p_pay_scale
     and pcv.business_group_id = g_business_group_id;
Line: 3620

  select spinal_point,psp.spinal_point_id
    from per_spinal_point_placements_f pspp,
         per_spinal_point_steps_f      psps,
         per_spinal_points             psp
   where pspp.assignment_id = p_assignment_id
     and pspp.step_id = psps.step_id
     and psps.spinal_point_id = psp.spinal_point_id
     and p_effective_date between pspp.effective_start_date and pspp.effective_end_date
     and p_effective_date between psps.effective_start_date and psps.effective_end_date;
Line: 3633

  select pcv.pcv_information3
    from pqp_configuration_values pcv
   where pcv.pcv_information_category = 'PQP_GB_SWF_SPINE_POINT_MAPPING'
     and pcv.pcv_information1  = p_pay_scale
     and pcv.pcv_information2  = p_spinal_point
     and pcv.business_group_id = g_business_group_id;
Line: 3641

  select to_char(value,'fm999999.00')
    from pay_grade_rules_f pgr
   where grade_or_spinal_point_id = p_spinal_point_id
     and p_effective_date between pgr.effective_start_date and pgr.effective_end_date;
Line: 3647

  select pcv_information1, pcv_information2, pcv_information3
    from pqp_configuration_values pcv
   where pcv.pcv_information_category = 'PQP_GB_SWF_REG_SPINE_SRC'
     and pcv.business_group_id = g_business_group_id;
Line: 3654

  select pcv.pcv_information4
    from pqp_configuration_values pcv
   where pcv.pcv_information_category = 'PQP_GB_SWF_REG_SPINE_MAP_PYSCL'
     and pcv.pcv_information1  = p_pay_scale
     and p_spinal_point    between pcv.pcv_information2 and pcv.pcv_information3
     and pcv.business_group_id = g_business_group_id;
Line: 3662

   select decode(tp_safeguarded_rate_type,'SN','True','SP','True','G','True','False')
     from pqp_assignment_attributes_f
    where assignment_id= p_assignment_id;
Line: 3724

      l_regional_spine_sql_str :='select pcv.pcv_information4
      from  per_all_assignments_f paf,
            per_grades pgr,
            per_grade_definitions pgd ,
            pqp_configuration_values pcv
      where paf.business_group_id + 0 = :bg_id
      and paf.business_group_id       = pgr.business_group_id
      and pcv.business_group_id       = paf.business_group_id
      and pgr.grade_definition_id     = pgd.grade_definition_id
      and paf.grade_id                = pgr.grade_id
      and :eff_date between paf.effective_start_date and paf.effective_end_date
      and paf.assignment_id                    = :assignment_id
      and pcv.pcv_information_category = ''PQP_GB_SWF_REG_SPINE_MAP_GRD''
      and ((pcv_information3          is null
      and pgd.'||l_regional_spine_segment||'                 = pcv.pcv_information2 )
      or (pcv_information3            is not null
      and pgd.'||l_regional_spine_segment||' between pcv.pcv_information2 and pcv_information3))';
Line: 3809

					select	 'Y'
						into	 l_valid_flag
						from	 dual
					 where	 exists
					 (select lookup_code
						 from	 hr_lookups hl
						 where	 hl.lookup_type = 'PQP_GB_REGIONAL_SPINE_CODE'
										 and hl.enabled_flag = 'Y'
										 and hl.lookup_code = l_reg_spinal_point_dcsf);
Line: 3836

					select	 'Y'
						into	 l_valid_flag
						from	 dual
					 where	 exists
											 (select lookup_code
											  from	 hr_lookups hl
											  where	 hl.lookup_type = 'PQP_GB_DCSF_SPINE_POINTS'
											  and    hl.enabled_flag = 'Y'
											  and    hl.lookup_code = l_spinal_point_dcsf);
Line: 3903

	select upper((pay_gb_eoy_archive.get_parameter(legislative_parameters,'DATA_RETURN_TYPE'))) data_return_type,
		(pay_gb_eoy_archive.get_parameter(legislative_parameters,'ESTB_NUM')) estb_num
	from pay_payroll_actions ppa
	where ppa.payroll_action_id = p_payroll_action_id;
Line: 3980

	select  (pay_gb_eoy_archive.get_parameter(legislative_parameters,'CENSUS_YEAR')) census_year,
		(pay_gb_eoy_archive.get_parameter(legislative_parameters,'CENSUS_DAY')) census_day,
		add_months(to_date((pay_gb_eoy_archive.get_parameter(legislative_parameters,'CONT_ST_DAY'))),-12) cont_st_day,
		(pay_gb_eoy_archive.get_parameter(legislative_parameters,'CONT_END_DAY')) cont_end_day,
		(pay_gb_eoy_archive.get_parameter(legislative_parameters,'LEA_NUM')) lea_num,
		upper((pay_gb_eoy_archive.get_parameter(legislative_parameters,'DATA_RETURN_TYPE'))) data_return_type,
		(pay_gb_eoy_archive.get_parameter(legislative_parameters,'ESTB_NUM')) estb_num,
		(pay_gb_eoy_archive.get_parameter(legislative_parameters,'EXCLUDE_ABS')) exclude_abs,
		(pay_gb_eoy_archive.get_parameter(legislative_parameters,'EXCLUDE_QUAL')) exclude_qual,
		business_group_id,
		ppa.payroll_action_id
	from pay_assignment_actions paa, pay_payroll_actions ppa
	where paa.assignment_action_id = p_assactid
	and paa.payroll_action_id = ppa.payroll_action_id;
Line: 3996

  select paa.assignment_id , paa.employment_category, paa.assignment_number
  from   pay_assignment_actions act,
         per_all_assignments_f      paa,
         per_assignment_status_types pas
  where  act.assignment_action_id = p_assactid
  and    act.assignment_id = paa.assignment_id
  and    p_census_day between paa.effective_start_date and paa.effective_end_date
  and    paa.assignment_status_type_id = pas.assignment_status_type_id
  and    pas.per_system_status = 'ACTIVE_ASSIGN';
Line: 4007

  select distinct pcv_information1
  from   pqp_configuration_values
  where  pcv_information_category = 'PQP_GB_SWF_CONTRACT_TYPE'
  and    business_group_id        = g_business_group_id;
Line: 4013

  select pcv_information1,pcv_information2
  from   pqp_configuration_values pcv
  where  pcv.pcv_information_category = 'PQP_GB_SWF_FTE_HOURS'
  and    pcv.business_group_id = g_business_group_id;
Line: 4170

         insert_archive_row(p_assactid, p_effective_date, l_archive_tab);
Line: 4225

		insert_archive_row(p_assactid, g_census_day, l_archive_tab);
Line: 4249

  select(pay_gb_eoy_archive.get_parameter(legislative_parameters,'CENSUS_YEAR')) census_year,
  (pay_gb_eoy_archive.get_parameter(legislative_parameters,'CENSUS_DAY')) census_day,
  add_months(to_date((pay_gb_eoy_archive.get_parameter(legislative_parameters,'CONT_ST_DAY'))),-12) cont_st_day,
  (pay_gb_eoy_archive.get_parameter(legislative_parameters,'CONT_END_DAY')) cont_end_day,
  (pay_gb_eoy_archive.get_parameter(legislative_parameters,'LEA_NUM')) lea_num,
  upper((pay_gb_eoy_archive.get_parameter(legislative_parameters,'DATA_RETURN_TYPE'))) data_return_type,
  (pay_gb_eoy_archive.get_parameter(legislative_parameters,'ESTB_NUM')) estb_num,
  (pay_gb_eoy_archive.get_parameter(legislative_parameters,'EXCLUDE_ABS')) exclude_abs,
  (pay_gb_eoy_archive.get_parameter(legislative_parameters,'EXCLUDE_QUAL')) exclude_qual,
  (pay_gb_eoy_archive.get_parameter(legislative_parameters,'ASG_SET')) asg_set,
  effective_date,
  business_group_id
  from   pay_payroll_actions
  where  payroll_action_id = pactid;
Line: 4265

   select     distinct
              peo.first_name          f_name ,
              peo.middle_names        m_name,
              peo.last_name           l_name,
              peo.title               title,
              peo.employee_number     emp_no,
              paf.assignment_number   asg_no,
              peo.national_identifier ni_no,
              paa.assignment_action_id asg_act_id
       from   pay_payroll_actions    pay,
              pay_assignment_actions paa,
              per_all_assignments_f  paf,
              per_all_people_f       peo,
               (select max(effective_end_date) effective_date,assignment_id
                from per_all_assignments_f
                group by assignment_id) max_eff_date
       where  pay.payroll_action_id = pactid
       and    paa.payroll_action_id = pay.payroll_action_id
       and    paf.assignment_id = paa.assignment_id
       and    peo.person_id = paf.person_id
       and    max_eff_date.assignment_id = paf.assignment_id
       and exists (select 'X'
                   from pay_message_lines pml
                   where paa.assignment_action_id = pml.source_id)
       and    max_eff_date.effective_date between paf.effective_start_date and paf.effective_end_date
       and    max_eff_date.effective_date between peo.effective_start_date and peo.effective_end_date;
Line: 4294

  select pml.line_text error_text
  from pay_message_lines pml
  where pml.source_id = p_asg_act_id
  and   pml.MESSAGE_LEVEL = 'F'
  and   pml.line_sequence < (select line_sequence
                             from pay_message_lines pml1
                             where pml1.source_id = p_asg_act_id
                             and   pml1.line_text like 'Error ORA-20001: Error(s) found while archiving data.')
  UNION ALL
  select pml.line_text error_text
  from pay_message_lines pml
  where pml.source_id = p_asg_act_id
  and   pml.message_level = 'W';
Line: 4312

   select     distinct
              peo.first_name          f_name ,
              peo.middle_names        m_name,
              peo.last_name           l_name,
              peo.title               title,
              peo.employee_number     emp_no,
              paf.assignment_number   asg_no,
              peo.national_identifier ni_no,
              paa.assignment_action_id asg_act_id
       from   pay_payroll_actions    pay,
              pay_assignment_actions paa,
              per_all_assignments_f  paf,
              per_all_people_f       peo,
               (select max(effective_end_date) effective_date,assignment_id
                from per_all_assignments_f
                group by assignment_id) max_eff_date
       where  pay.payroll_action_id = pactid
       and    paa.payroll_action_id = pay.payroll_action_id
       and    paf.assignment_id = paa.assignment_id
       and    peo.person_id = paf.person_id
       and    max_eff_date.assignment_id = paf.assignment_id
       and not exists (select 'X'
                   from pay_message_lines pml
                   where paa.assignment_action_id = pml.source_id
		   and message_level <> 'W')
       and    max_eff_date.effective_date between paf.effective_start_date and paf.effective_end_date
       and    max_eff_date.effective_date between peo.effective_start_date and peo.effective_end_date;
Line: 4341

	select action_information4 person_id,sum(action_information7)
	from pay_action_information pai,
	      pay_payroll_actions ppa,
	      pay_assignment_actions paa
	where ppa.payroll_action_id = pactid
	and ppa.payroll_action_id = paa.payroll_action_id
	and paa.assignment_action_id = pai.action_context_id
	and pai.action_information_category = 'GB_SWF_HOURS_DETAILS'
	and action_information5 IN ('PRM','TMP','FXT')
	and action_information6 is null
	group by action_information4
	having sum(action_information7) > 1.5;
Line: 4355

	select       peo.first_name          f_name ,
	peo.middle_names        m_name,
	peo.last_name           l_name,
	peo.title               title,
	peo.employee_number     emp_no,
	peo.national_identifier ni_no
	from         per_all_people_f       peo
	where        person_id = p_person_id;
Line: 4367

	select COUNT(*)
	from pay_action_information pai,
	      pay_payroll_actions ppa,
	      pay_assignment_actions paa
	where ppa.payroll_action_id = pactid
	and ppa.payroll_action_id = paa.payroll_action_id
	and paa.assignment_action_id = pai.action_context_id
	and pai.action_information_category = 'GB_SWF_ROLE_DETAILS'
	and action_information1 = 'HDTR';
Line: 4384

  select COUNT(*)
	from pay_action_information pai,
	      pay_payroll_actions ppa,
	      pay_assignment_actions paa
	where ppa.payroll_action_id = pactid
	and ppa.payroll_action_id = paa.payroll_action_id
	and paa.assignment_action_id = pai.action_context_id
	and pai.action_information_category = 'GB_SWF_ROLE_DETAILS'
	and action_information1 = 'EPSY'
  and action_information2 = 'F';
Line: 4396

  select COUNT(*)
	from pay_action_information pai,
	      pay_payroll_actions ppa,
	      pay_assignment_actions paa
	where ppa.payroll_action_id = pactid
	and ppa.payroll_action_id = paa.payroll_action_id
	and paa.assignment_action_id = pai.action_context_id
	and pai.action_information_category = 'GB_SWF_ROLE_DETAILS'
	and action_information1 = 'EPSY'
  and action_information2 = 'P';
Line: 4408

  select sum(pai2.action_information7)
	from pay_action_information pai,
       pay_action_information pai2,
	     pay_payroll_actions ppa,
	     pay_assignment_actions paa
	where ppa.payroll_action_id = pactid
	and ppa.payroll_action_id = paa.payroll_action_id
	and paa.assignment_action_id = pai.action_context_id
  and pai.action_context_id = pai2.action_context_id
	and pai.action_information_category = 'GB_SWF_ROLE_DETAILS'
	and pai2.action_information_category = 'GB_SWF_HOURS_DETAILS'
	and pai.action_information1 = 'EPSY'
  and pai.action_information2 = 'P';