DBA Data[Home] [Help]

APPS.PER_ASG_BUS1 SQL Statements

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

Line: 30

    select pbg.security_group_id, pbg.legislation_code
     from per_business_groups_perf  pbg
      where  pbg.business_group_id =  (select distinct asg.business_group_id  from
                                     per_all_assignments_f    asg
                                    where asg.assignment_id  = p_assignment_id);
Line: 116

Procedure check_non_updateable_args(p_rec in per_asg_shd.g_rec_type
                                   ,p_effective_date in date) is
--
  l_proc     varchar2(72) := g_package||'check_non_updateable_args';
Line: 205

end check_non_updateable_args;
Line: 210

Procedure delete_validate
    (p_rec                         in per_asg_shd.g_rec_type,
     p_effective_date              in date,
     p_datetrack_mode              in varchar2,
     p_validation_start_date       in date,
     p_validation_end_date         in date,
     p_org_now_no_manager_warning  out nocopy boolean,
     p_loc_change_tax_issues       OUT nocopy boolean,
     p_delete_asg_budgets          OUT nocopy boolean,
     p_element_salary_warning      OUT nocopy boolean,
     p_element_entries_warning     OUT nocopy boolean,
     p_spp_warning                 OUT nocopy boolean,
     p_cost_warning                OUT nocopy boolean,
     p_life_events_exists   	   OUT nocopy boolean,
     p_cobra_coverage_elements     OUT nocopy boolean,
     p_assgt_term_elements         OUT nocopy boolean,
     ---
     p_new_prim_ass_id             OUT nocopy number,
     p_prim_change_flag            OUT nocopy varchar2,
     p_new_end_date                OUT nocopy date,
     p_new_primary_flag            OUT nocopy varchar2,
     p_s_pay_id                    OUT nocopy number,
     p_cancel_atd                  OUT nocopy date,
     p_cancel_lspd                 OUT nocopy date,
     p_reterm_atd                  OUT nocopy date,
     p_reterm_lspd                 OUT nocopy date,
     ---
     p_appl_asg_new_end_date       OUT nocopy date  ) is
  --
  l_proc                   varchar2(72);
Line: 244

  l_delete_asg_budgets         boolean;
Line: 255

  l_proc:= g_package||'delete_validate';
Line: 264

       hr_utility.set_location('Selected assignment is of type Benifits', 10);
Line: 272

    hr_utility.set_location('Before calling pre_delete checks ', 20);
Line: 276

 if (p_datetrack_mode <> 'DELETE') THEN
 hr_assignment_internal.pre_delete
    (p_rec                        => p_rec,
     p_effective_date             => p_effective_date,
     p_datetrack_mode             => p_datetrack_mode,
     p_validation_start_date      => p_validation_start_date,
     p_validation_end_date        => p_validation_end_date,
     p_org_now_no_manager_warning => p_org_now_no_manager_warning,
     p_loc_change_tax_issues      => l_loc_change_tax_issues,
     p_delete_asg_budgets         => l_delete_asg_budgets,
     p_element_salary_warning     => l_element_salary_warning,
     p_element_entries_warning    => l_element_entries_warning,
     p_spp_warning                => l_spp_warning,
     P_cost_warning               => l_cost_warning,
     p_life_events_exists   	  => l_life_events_exists,
     p_cobra_coverage_elements    => l_cobra_coverage_elements,
     p_assgt_term_elements        => l_assgt_term_elements,
     ---
     p_new_prim_ass_id            => p_new_prim_ass_id,
     p_prim_change_flag           => p_prim_change_flag,
     p_new_end_date               => p_new_end_date,
     p_new_primary_flag           => p_new_primary_flag,
     p_s_pay_id                   => p_s_pay_id,
     p_cancel_atd                 => p_cancel_atd,
     p_cancel_lspd                => p_cancel_lspd,
     p_reterm_atd                 => p_reterm_atd,
     p_reterm_lspd                => p_reterm_lspd,
     ---
     p_appl_asg_new_end_date      => p_appl_asg_new_end_date );
Line: 359

  per_asg_bus1.dt_delete_validate

    (p_assignment_id        => p_rec.assignment_id
    ,p_datetrack_mode        => p_datetrack_mode
    ,p_validation_start_date    => p_validation_start_date
    ,p_validation_end_date    => p_validation_end_date
    );
Line: 380

    ,p_payroll_id_updated     =>  l_temp_flag
    ,p_object_version_number  =>  p_rec.object_version_number
    );
Line: 400

  per_pqh_shr.per_asg_bus('DELETE_VALIDATE',
                p_rec,
                            p_effective_date,
                            p_validation_start_date,
                            p_validation_end_date,
                            p_datetrack_mode);
Line: 410

End delete_validate;
Line: 447

Procedure dt_delete_validate
            (p_assignment_id        in number,
             p_datetrack_mode        in varchar2,
         p_validation_start_date    in date,
         p_validation_end_date    in date) Is
--
  l_proc    varchar2(72)     := g_package||'dt_delete_validate';
Line: 472

  If (p_datetrack_mode = 'DELETE' or
      p_datetrack_mode = 'ZAP') then
    --
    --
    -- Ensure the arguments are not null
    --
    hr_api.mandatory_arg_error
      (p_api_name       => l_proc,
       p_argument       => 'validation_start_date',
       p_argument_value => p_validation_start_date);
Line: 597

End dt_delete_validate;
Line: 628

Procedure dt_update_validate
            (p_payroll_id                    in number default hr_api.g_number,
             p_person_id                     in number default hr_api.g_number,
         p_datetrack_mode             in varchar2,
             p_validation_start_date         in date,
         p_validation_end_date         in date) Is
--
  l_proc        varchar2(72) := g_package||'dt_update_validate';
Line: 706

End dt_update_validate;
Line: 985

Procedure insert_validate
    (p_rec                in out nocopy  per_asg_shd.g_rec_type,
     p_effective_date           in  date,
     p_datetrack_mode           in  varchar2,
     p_validation_start_date       in  date,
     p_validation_end_date           in  date,
         p_validate_df_flex            in  boolean,
         p_other_manager_warning       out nocopy boolean,
         p_hourly_salaried_warning     out nocopy boolean,
         p_inv_pos_grade_warning       out nocopy boolean
        ) is
  l_proc                    varchar2(72);
Line: 1006

  l_proc := g_package||'insert_validate';
Line: 1109

select source_type into l_source_type from per_all_assignments_f
where person_id = p_rec.person_id and BUSINESS_GROUP_ID = p_rec.business_group_id
and ASSIGNMENT_TYPE = 'A' and VACANCY_ID = p_rec.vacancy_id and
p_effective_date between EFFECTIVE_START_DATE and EFFECTIVE_END_DATE;
Line: 1722

    ,p_payroll_id_updated     =>  l_temp_flag
    ,p_object_version_number  =>  p_rec.object_version_number
    );
Line: 2037

    per_pqh_shr.per_asg_bus('INSERT_VALIDATE',
                p_rec,
                            p_effective_date,
                            p_validation_start_date,
                            p_validation_end_date,
                            p_datetrack_mode);
Line: 2054

    pqh_psf_bus.per_asg_bus_insert_validate
         (p_position_id    => p_rec.position_id
         ,p_assignment_date   => p_effective_date
         ,p_assignment_grade_id  => p_rec.grade_id
         ,p_assignment_emp_cat   => p_rec.employment_category
         );
Line: 2069

End insert_validate;
Line: 2074

Procedure update_validate
    (p_rec                in out nocopy  per_asg_shd.g_rec_type,

     p_effective_date           in  date,
     p_datetrack_mode           in  varchar2,
     p_validation_start_date       in  date,
     p_validation_end_date           in   date,
         p_payroll_id_updated          out nocopy  boolean,
         p_other_manager_warning       out nocopy  boolean,
         p_hourly_salaried_warning     out nocopy  boolean,
         p_no_managers_warning         out nocopy  boolean,
         p_org_now_no_manager_warning  out nocopy  boolean,
         p_inv_pos_grade_warning       out nocopy  boolean
         ) is
--
  l_proc                   varchar2(72);
Line: 2097

  l_payroll_id_updated         boolean;
Line: 2106

  l_proc := g_package||'update_validate';
Line: 2137

  per_asg_bus1.check_non_updateable_args
    (p_rec            => p_rec
    ,p_effective_date => p_effective_date
    );
Line: 2857

    ,p_payroll_id_updated     =>  l_payroll_id_updated
    ,p_object_version_number  =>  p_rec.object_version_number
    );
Line: 3193

  per_asg_bus1.dt_update_validate
    (p_payroll_id                    => p_rec.payroll_id,
     p_person_id                     => p_rec.person_id,
     p_datetrack_mode                => p_datetrack_mode,
     p_validation_start_date         => p_validation_start_date,
     p_validation_end_date         => p_validation_end_date);
Line: 3206

  p_payroll_id_updated         := l_payroll_id_updated;
Line: 3212

    per_pqh_shr.per_asg_bus('UPDATE_VALIDATE',
                p_rec,
                            p_effective_date,
                            p_validation_start_date,
                            p_validation_end_date,
                            p_datetrack_mode);
Line: 3229

    pqh_psf_bus.per_asg_bus_update_validate
         (p_position_id    => p_rec.position_id
         ,p_assignment_id  => p_rec.assignment_id
         ,p_assignment_date   => p_rec.effective_start_date
         ,p_assignment_grade_id  => p_rec.grade_id
         ,p_assignment_emp_cat   => p_rec.employment_category
         );
Line: 3246

End update_validate;
Line: 3270

    select   business_group_id
    from     per_applications
    where    application_id = p_application_id
    and      date_received = p_validation_start_date;
Line: 3276

    select   business_group_id
    from     per_applications
    where    application_id = p_application_id
    and      p_validation_start_date
      between date_received
      and     nvl(date_end,hr_api.g_eot);
Line: 3442

      else -- inserted an employee assignment
        --
        -- Check that application is null
        --
        If p_application_id is not null then
          --
          hr_utility.set_message(801, 'HR_51211_ASG_INV_E_ASG_APL_ID');
Line: 3488

     select   decode(p_assignment_type,'E',employee_number,'C',npw_number)
     from     per_all_people_f --#3663845 per_people_f
     where    person_id = p_person_id
     and      p_effective_date between effective_start_date
                               and     effective_end_date;
Line: 3838

    select ast.per_system_status
         , ast.business_group_id
      from per_assignment_status_types ast
     where ast.assignment_status_type_id = p_assignment_status_type_id;
Line: 3979

    select   legislation_code, active_flag, business_group_id, per_system_status
    from     per_assignment_status_types
    where    assignment_status_type_id = p_rec.assignment_status_type_id;
Line: 3987

    select legislation_code
    from   per_business_groups_perf
    where  business_group_id = p_rec.business_group_id;
Line: 3995

    select   active_flag, per_system_status
    from     per_ass_status_type_amends
    where    assignment_status_type_id = p_rec.assignment_status_type_id
    and      business_group_id = p_rec.business_group_id;
Line: 4004

    select per_system_status
    from   per_assignment_status_types
    where  assignment_status_type_id =
           per_asg_shd.g_old_rec.assignment_status_type_id;
Line: 4014

    select nvl(min(asg.effective_start_date), hr_api.g_eot)
    from   per_all_assignments_f           asg
          ,per_assignment_status_types ast
    where asg.assignment_id             = p_rec.assignment_id
    and   ast.assignment_status_type_id = asg.assignment_status_type_id
    and   ast.per_system_status         = 'ACTIVE_ASSIGN';
Line: 4025

    select min(effective_start_date)
    from per_all_assignments_f
    where assignment_id = p_rec.assignment_id
    and   assignment_type = 'A';
Line: 4036

    select ast.per_system_status
    from   per_all_assignments_f           asg
          ,per_assignment_status_types ast
    where asg.assignment_id             = p_rec.assignment_id
    and   asg.effective_start_date      = c_effective_start_date
    and   ast.assignment_status_type_id = asg.assignment_status_type_id;
Line: 4209

          or  p_rec.program_update_date                              <>
            per_asg_shd.g_old_rec.program_update_date
          or  p_rec.ass_attribute_category                           <>
            per_asg_shd.g_old_rec.ass_attribute_category
          )
          then
          --
          hr_utility.set_message(801, 'HR_7946_ASG_INV_TERM_ASS_UPD');
Line: 4500

      else  -- Inserting Employee assignment
        --
        -- Check that the per_system_status is 'ACTIVE_ASSIGN'
        --
        if l_per_system_status <> 'ACTIVE_ASSIGN'
          then
          --
          hr_utility.set_message(801, 'HR_7941_ASG_INV_STAT_NOT_ACT');
Line: 4552

     ELSE -- Inserting
       --
if g_debug then
      hr_utility.set_location(l_proc, 190);
Line: 4625

    select   pet.system_person_type
    from     per_people_f per,
             per_person_types pet
    where    per.person_id      = p_person_id
    and      per.person_type_id = pet.person_type_id
    and      p_validation_start_date
      between  effective_start_date
        and    effective_end_date;
Line: 5002

     select   null
     from     sys.dual
     where exists(select  null
                  from    per_all_assignments_f pas
                  ,       per_periods_of_service ppos
                  where   pas.effective_start_date <= p_effective_date
                  and     ppos.period_of_service_id = pas.period_of_service_id
                  and     pas.person_id = p_person_id
                  and     pas.primary_flag = 'N'
                  and (exists(select null
                              from   per_all_assignments_f pas2
                              ,      per_periods_of_service ppos2
                              where  pas2.effective_end_date =
                                nvl(ppos2.actual_termination_date, hr_api.g_eot)
                              and    pas.assignment_id = pas2.assignment_id
                              and    pas2.period_of_service_id = ppos2.period_of_service_id )));  -- Added this last filter for Bug 4300591.
Line: 5038

  if p_datetrack_mode = 'DELETE' and p_primary_flag = 'Y' then
    open csr_chk_contig_ass;
Line: 5090

    select   min(effective_start_date)
    from     per_all_assignments_f
    where    assignment_id = p_assignment_id;
Line: 5227

    select   null
    from     gl_code_combinations
    where    code_combination_id = p_default_code_comb_id
    and      enabled_flag = 'Y'
    and      p_validation_start_date
      between nvl(start_date_active,hr_api.g_sot)
        and     nvl(end_date_active,hr_api.g_eot);
Line: 5720

     select   null
     from     per_all_assignments_f
     where    assignment_id = p_assignment_id
     and      effective_start_date >= p_effective_date
     and      primary_flag = 'Y';
Line: 5743

  if p_datetrack_mode = 'DELETE' and
     p_primary_flag = 'N' then
    open csr_chk_fut_prim;
Line: 5798

    select   business_group_id
    from     per_grades
    where    grade_id = p_grade_id
    and      p_validation_start_date
      between date_from and nvl(date_to, hr_api.g_eot);
Line: 5948

    select   business_group_id
    from     per_jobs_v
    where    job_id = p_job_id
    and      p_validation_start_date
      between  date_from
      and      nvl(date_to, hr_api.g_eot);
Line: 5956

    select  job.business_group_id
    from     per_jobs job
           , per_job_groups jgr
    where    job.job_id = p_job_id
    and      (p_validation_start_date
       between  job.date_from
       and      nvl(job.date_to, hr_api.g_eot))
    and     job.job_group_id = jgr.job_group_id
    and jgr.internal_name = 'HR_'||jgr.business_group_id
    and (jgr.business_group_id = job.business_group_id
         or jgr.business_group_id is null);
Line: 6101

    select   null
    from     per_valid_grades
    where    job_id = p_job_id
    and      p_validation_start_date
      between  date_from
      and      nvl(date_to, hr_api.g_eot);
Line: 6111

    select   null
    from     per_valid_grades
    where    job_id = p_job_id
    and      grade_id = p_grade_id
    and      p_validation_start_date
      between  date_from
      and      nvl(date_to, hr_api.g_eot);
Line: 6255

       select inactive_date
       from  hr_locations_all
       where  location_id =  p_location_id
       and (business_group_id= (
               select distinct business_group_id
               from per_all_assignments_f
               where assignment_id= p_assignment_id)
       or business_group_id is null);
Line: 6266

       select inactive_date
       from  hr_locations_all
       where  location_id =  p_location_id
       and (business_group_id= nvl(hr_general.get_business_group_id,business_group_id)
       or business_group_id is null);
Line: 6698

    select   business_group_id
    from     hr_all_organization_units
    where    organization_id     = p_organization_id
    and      internal_external_flag = 'INT';
Line: 6704

    select   null
    from     per_organization_units
    where    organization_id     = p_organization_id;
Line: 7037

  select pay.pay_basis
  from per_pay_bases pay
  where pay.pay_basis_id = p_pay_basis_id;
Line: 7128

  select pbg.legislation_code
      from per_business_groups_perf  pbg
      where  pbg.business_group_id =  (select distinct asg.business_group_id  from
                                     per_all_assignments_f    asg
                                    where asg.assignment_id  = p_assignment_id);
Line: 7207

 select 'x'
 from per_position_extra_info
 where position_id= p_position_id
   and information_type = 'PER_OVERLAP';
Line: 7213

select 'x'
from per_position_extra_info
where p_assignment_start_date
      between fnd_date.canonical_to_date(poei_information3)
      and fnd_date.canonical_to_date(poei_information4)
      and position_id= p_position_id -- l_position_id -- for bug 7129787
      and information_type = 'PER_OVERLAP';
Line: 7302

  select position_type, availability_status_id, business_group_id
  from hr_all_positions_f
  where position_id = p_position_id
  and p_effective_date between effective_start_date and effective_end_date;
Line: 7458

select 'x'
from per_all_assignments_f asg, per_assignment_status_types ast
where position_id = p_position_id
and assignment_id <> nvl(p_except_assignment_id, -1)
and ( assignment_type = 'E' /*or assignment_type = 'A'*/)  -- change for the bug 5854568(modified for 6331872)
and p_effective_date between effective_start_date and effective_end_date
and asg.assignment_status_type_id = ast.assignment_status_type_id
and ast.per_system_status <> 'TERM_ASSIGN';