DBA Data[Home] [Help]

APPS.HR_PERSON_DEPLOYMENT_SWI SQL Statements

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

Line: 240

PROCEDURE update_person_deployment
  (p_validate                     in     number    default hr_api.g_false_num
  ,p_person_deployment_id         in     number
  ,p_object_version_number        in out nocopy number
  ,p_person_type_id               in     number    default hr_api.g_number
  ,p_start_date                   in     date      default hr_api.g_date
  ,p_end_date                     in     date      default hr_api.g_date
  ,p_employee_number              in     varchar2  default hr_api.g_varchar2
  ,p_leaving_reason               in     varchar2  default hr_api.g_varchar2
  ,p_leaving_person_type_id       in     number    default hr_api.g_number
  ,p_status                       in     varchar2  default hr_api.g_varchar2
  ,p_status_change_reason         in     varchar2  default hr_api.g_varchar2
  ,p_deplymt_policy_id            in     number    default hr_api.g_number
  ,p_organization_id              in     number    default hr_api.g_number
  ,p_location_id                  in     number    default hr_api.g_number
  ,p_job_id                       in     number    default hr_api.g_number
  ,p_position_id                  in     number    default hr_api.g_number
  ,p_grade_id                     in     number    default hr_api.g_number
  ,p_supervisor_id                in     number    default hr_api.g_number
  ,p_supervisor_assignment_id     in     number    default hr_api.g_number
  ,p_retain_direct_reports        in     varchar2  default hr_api.g_varchar2
  ,p_payroll_id                   in     number    default hr_api.g_number
  ,p_pay_basis_id                 in     number    default hr_api.g_number
  ,p_proposed_salary              in     varchar2  default hr_api.g_varchar2
  ,p_people_group_id              in     number    default hr_api.g_number
  ,p_soft_coding_keyflex_id       in     number    default hr_api.g_number
  ,p_assignment_status_type_id    in     number    default hr_api.g_number
  ,p_ass_status_change_reason     in     varchar2  default hr_api.g_varchar2
  ,p_assignment_category          in     varchar2  default hr_api.g_varchar2
  ,p_per_information1             in     varchar2  default hr_api.g_varchar2
  ,p_per_information2             in     varchar2  default hr_api.g_varchar2
  ,p_per_information3             in     varchar2  default hr_api.g_varchar2
  ,p_per_information4             in     varchar2  default hr_api.g_varchar2
  ,p_per_information5             in     varchar2  default hr_api.g_varchar2
  ,p_per_information6             in     varchar2  default hr_api.g_varchar2
  ,p_per_information7             in     varchar2  default hr_api.g_varchar2
  ,p_per_information8             in     varchar2  default hr_api.g_varchar2
  ,p_per_information9             in     varchar2  default hr_api.g_varchar2
  ,p_per_information10            in     varchar2  default hr_api.g_varchar2
  ,p_per_information11            in     varchar2  default hr_api.g_varchar2
  ,p_per_information12            in     varchar2  default hr_api.g_varchar2
  ,p_per_information13            in     varchar2  default hr_api.g_varchar2
  ,p_per_information14            in     varchar2  default hr_api.g_varchar2
  ,p_per_information15            in     varchar2  default hr_api.g_varchar2
  ,p_per_information16            in     varchar2  default hr_api.g_varchar2
  ,p_per_information17            in     varchar2  default hr_api.g_varchar2
  ,p_per_information18            in     varchar2  default hr_api.g_varchar2
  ,p_per_information19            in     varchar2  default hr_api.g_varchar2
  ,p_per_information20            in     varchar2  default hr_api.g_varchar2
  ,p_per_information21            in     varchar2  default hr_api.g_varchar2
  ,p_per_information22            in     varchar2  default hr_api.g_varchar2
  ,p_per_information23            in     varchar2  default hr_api.g_varchar2
  ,p_per_information24            in     varchar2  default hr_api.g_varchar2
  ,p_per_information25            in     varchar2  default hr_api.g_varchar2
  ,p_per_information26            in     varchar2  default hr_api.g_varchar2
  ,p_per_information27            in     varchar2  default hr_api.g_varchar2
  ,p_per_information28            in     varchar2  default hr_api.g_varchar2
  ,p_per_information29            in     varchar2  default hr_api.g_varchar2
  ,p_per_information30            in     varchar2  default hr_api.g_varchar2
  ,p_deployment_reason            in     varchar2  default hr_api.g_varchar2
  ,p_return_status                   out nocopy varchar2
  ) is
  --
  -- Variables for API Boolean parameters
  l_validate                      boolean;
Line: 311

  l_proc    varchar2(72) := g_package ||'update_person_deployment';
Line: 317

  savepoint update_person_deployment_swi;
Line: 338

  hr_person_deployment_api.update_person_deployment
    (p_validate                     => l_validate
    ,p_person_deployment_id         => p_person_deployment_id
    ,p_object_version_number        => p_object_version_number
    ,p_person_type_id               => p_person_type_id
    ,p_start_date                   => p_start_date
    ,p_end_date                     => p_end_date
    ,p_deployment_reason            => p_deployment_reason
    ,p_employee_number              => p_employee_number
    ,p_leaving_reason               => p_leaving_reason
    ,p_leaving_person_type_id       => p_leaving_person_type_id
    ,p_status                       => p_status
    ,p_status_change_reason         => p_status_change_reason
    ,p_deplymt_policy_id            => p_deplymt_policy_id
    ,p_organization_id              => p_organization_id
    ,p_location_id                  => p_location_id
    ,p_job_id                       => p_job_id
    ,p_position_id                  => p_position_id
    ,p_grade_id                     => p_grade_id
    ,p_supervisor_id                => p_supervisor_id
    ,p_supervisor_assignment_id     => p_supervisor_assignment_id
    ,p_retain_direct_reports        => p_retain_direct_reports
    ,p_payroll_id                   => p_payroll_id
    ,p_pay_basis_id                 => p_pay_basis_id
    ,p_proposed_salary              => p_proposed_salary
    ,p_people_group_id              => p_people_group_id
    ,p_soft_coding_keyflex_id       => p_soft_coding_keyflex_id
    ,p_assignment_status_type_id    => p_assignment_status_type_id
    ,p_ass_status_change_reason     => p_ass_status_change_reason
    ,p_assignment_category          => p_assignment_category
    ,p_per_information1             => p_per_information1
    ,p_per_information2             => p_per_information2
    ,p_per_information3             => p_per_information3
    ,p_per_information4             => p_per_information4
    ,p_per_information5             => p_per_information5
    ,p_per_information6             => p_per_information6
    ,p_per_information7             => p_per_information7
    ,p_per_information8             => p_per_information8
    ,p_per_information9             => p_per_information9
    ,p_per_information10            => p_per_information10
    ,p_per_information11            => p_per_information11
    ,p_per_information12            => p_per_information12
    ,p_per_information13            => p_per_information13
    ,p_per_information14            => p_per_information14
    ,p_per_information15            => p_per_information15
    ,p_per_information16            => p_per_information16
    ,p_per_information17            => p_per_information17
    ,p_per_information18            => p_per_information18
    ,p_per_information19            => p_per_information19
    ,p_per_information20            => p_per_information20
    ,p_per_information21            => p_per_information21
    ,p_per_information22            => p_per_information22
    ,p_per_information23            => p_per_information23
    ,p_per_information24            => p_per_information24
    ,p_per_information25            => p_per_information25
    ,p_per_information26            => p_per_information26
    ,p_per_information27            => p_per_information27
    ,p_per_information28            => p_per_information28
    ,p_per_information29            => p_per_information29
    ,p_per_information30            => p_per_information30
    ,p_policy_duration_warning      => l_policy_duration_warning
    );
Line: 430

    rollback to update_person_deployment_swi;
Line: 445

    rollback to update_person_deployment_swi;
Line: 456

end update_person_deployment;
Line: 460

PROCEDURE delete_person_deployment
  (p_validate                     in     number    default hr_api.g_false_num
  ,p_person_deployment_id         in     number
  ,p_object_version_number        in     number
  ,p_return_status                   out nocopy varchar2
  ) is
  --
  -- Variables for API Boolean parameters
  l_validate                      boolean;
Line: 473

  l_proc    varchar2(72) := g_package ||'delete_person_deployment';
Line: 476

  select hat.transaction_id transaction_id,
         hats.transaction_step_id transaction_step_id
  from hr_api_transactions hat,
       hr_api_transaction_steps hats
  where hat.transaction_ref_table='HR_PERSON_DEPLOYMENT'
  and hat.transaction_id = hats.transaction_id
  and hats.information1 = to_char(p_person_deployment_id);
Line: 489

  savepoint delete_person_deployment_swi;
Line: 510

  hr_person_deployment_api.delete_person_deployment
    (p_validate                     => l_validate
    ,p_person_deployment_id         => p_person_deployment_id
    ,p_object_version_number        => p_object_version_number
    );
Line: 519

       hr_transaction_swi.delete_transaction(p_transaction_id => a.transaction_id);
Line: 543

    rollback to delete_person_deployment_swi;
Line: 557

    rollback to delete_person_deployment_swi;
Line: 567

end delete_person_deployment;
Line: 905

procedure update_attachment
          (p_entity_name        in varchar2 default null
          ,p_pk1_value          in varchar2 default null
          ,p_rowid              in varchar2 ) is



  l_proc    varchar2(72) := g_package ||'update_attachment';
Line: 919

    select *
    from   fnd_attached_documents
    where  rowid = p_rowid;
Line: 924

    select *
    from   fnd_documents
    where  document_id = csr_p_document_id;
Line: 930

    select *
    from   fnd_documents_tl
    where  document_id = csr_p_document_id
    and    language = csr_p_lang;
Line: 944

    select userenv('LANG') into l_language from dual;
Line: 1043

        hr_utility.set_location(' before fnd_attached_documents_pkg.update_row :' || l_proc,30);
Line: 1044

            fnd_attached_documents_pkg.update_row
            (x_rowid                      => p_rowid
            ,x_attached_document_id       =>
                        l_attached_doc_pre_upd.attached_document_id
            ,x_document_id                => l_doc_pre_upd.document_id
            ,x_last_update_date           => trunc(sysdate)
            ,x_last_updated_by            => l_attached_doc_pre_upd.last_updated_by
            ,x_seq_num                    => l_attached_doc_pre_upd.seq_num
            ,x_entity_name                => p_entity_name
            ,x_column1                    => l_attached_doc_pre_upd.column1
            ,x_pk1_value                  => p_pk1_value
            ,x_pk2_value                  => l_attached_doc_pre_upd.pk2_value
            ,x_pk3_value                  => l_attached_doc_pre_upd.pk3_value
            ,x_pk4_value                  => l_attached_doc_pre_upd.pk4_value
            ,x_pk5_value                  => l_attached_doc_pre_upd.pk5_value
            ,x_automatically_added_flag   =>
                      l_attached_doc_pre_upd.automatically_added_flag
            ,x_attribute_category         =>
                      l_attached_doc_pre_upd.attribute_category
            ,x_attribute1                 => l_attached_doc_pre_upd.attribute1
            ,x_attribute2                 => l_attached_doc_pre_upd.attribute2
            ,x_attribute3                 => l_attached_doc_pre_upd.attribute3
            ,x_attribute4                 => l_attached_doc_pre_upd.attribute4
            ,x_attribute5                 => l_attached_doc_pre_upd.attribute5
            ,x_attribute6                 => l_attached_doc_pre_upd.attribute6
            ,x_attribute7                 => l_attached_doc_pre_upd.attribute7
            ,x_attribute8                 => l_attached_doc_pre_upd.attribute8
            ,x_attribute9                 => l_attached_doc_pre_upd.attribute9
            ,x_attribute10                => l_attached_doc_pre_upd.attribute10
            ,x_attribute11                => l_attached_doc_pre_upd.attribute11
            ,x_attribute12                => l_attached_doc_pre_upd.attribute12
            ,x_attribute13                => l_attached_doc_pre_upd.attribute13
            ,x_attribute14                => l_attached_doc_pre_upd.attribute14
            ,x_attribute15                => l_attached_doc_pre_upd.attribute15
            /*   columns necessary for creating a document on the fly  */
            ,x_datatype_id                => l_doc_pre_upd.datatype_id
            ,x_category_id                => l_doc_pre_upd.category_id
            ,x_security_type              => l_doc_pre_upd.security_type
            ,x_security_id                => l_doc_pre_upd.security_id
            ,x_publish_flag               => l_doc_pre_upd.publish_flag
            ,x_image_type                 => l_doc_pre_upd.image_type
            ,x_storage_type               => l_doc_pre_upd.storage_type
            ,x_usage_type                 => l_doc_pre_upd.usage_type
           ,x_start_date_active          => trunc(sysdate)
            ,x_end_date_active            => l_doc_pre_upd.end_date_active
            ,x_language                   => l_language
            ,x_description                => l_doc_tl_pre_upd.description
            ,x_file_name                  => l_doc_pre_upd.file_name
            ,x_media_id                   => l_doc_pre_upd.media_id
            ,x_doc_attribute_category     =>
                      l_doc_tl_pre_upd.doc_attribute_category
            ,x_doc_attribute1             => l_doc_tl_pre_upd.doc_attribute1
            ,x_doc_attribute2             => l_doc_tl_pre_upd.doc_attribute2
            ,x_doc_attribute3             => l_doc_tl_pre_upd.doc_attribute3
            ,x_doc_attribute4             => l_doc_tl_pre_upd.doc_attribute4
            ,x_doc_attribute5             => l_doc_tl_pre_upd.doc_attribute5
            ,x_doc_attribute6             => l_doc_tl_pre_upd.doc_attribute6
            ,x_doc_attribute7             => l_doc_tl_pre_upd.doc_attribute7
            ,x_doc_attribute8             => l_doc_tl_pre_upd.doc_attribute8
            ,x_doc_attribute9             => l_doc_tl_pre_upd.doc_attribute9
            ,x_doc_attribute10            => l_doc_tl_pre_upd.doc_attribute10
            ,x_doc_attribute11            => l_doc_tl_pre_upd.doc_attribute11
            ,x_doc_attribute12            => l_doc_tl_pre_upd.doc_attribute12
            ,x_doc_attribute13            => l_doc_tl_pre_upd.doc_attribute13
            ,x_doc_attribute14            => l_doc_tl_pre_upd.doc_attribute14
            ,x_doc_attribute15            => l_doc_tl_pre_upd.doc_attribute15
            ,x_url                        => l_doc_pre_upd.url
            ,x_title                      => l_doc_tl_pre_upd.title
            );
Line: 1114

  hr_utility.set_location(' after fnd_attached_documents_pkg.update_row :' || l_proc,40);
Line: 1122

  End update_attachment;
Line: 1141

    select *
    from   fnd_attached_documents
    where  entity_name=lv_entity_name
     and   pk1_value=lv_pk1_value;
Line: 1147

    SELECT rowid
    FROM fnd_attached_documents
    WHERE attached_document_id = X_attached_document_id;
Line: 1171

        update_attachment
          (p_entity_name=>lv_entity_name
          ,p_pk1_value=> p_absence_attendance_id
          ,p_rowid=>l_rowid);
Line: 1227

   select person_deployment_id, from_person_id,from_business_group_id
   from hr_person_deployments
   where person_deployment_id = p_person_deployment_id;
Line: 1262

        if(lv_action='UpdateMode') then
        -- set the poststate to update
        l_postState:= '2';
Line: 1345

	  select max(hat.transaction_id)
          into l_transaction_id
          from hr_api_transactions hat,hr_api_transaction_steps hats
          where hat.transaction_id = hats.transaction_id
          and  hats.information1 = l_person_deployment_id
          and hats.information12 = 'CreateMode';
Line: 1367

   update_person_deployment
    (p_validate                      => p_validate
    ,p_person_deployment_id          => hr_transaction_swi.getNumberValue(l_CommitNode,'PersonDeploymentId')
    ,P_OBJECT_VERSION_NUMBER         => l_object_version_number
    ,P_PERSON_TYPE_ID                => hr_transaction_swi.getNumberValue(l_CommitNode,'PersonTypeId')
    ,P_START_DATE                    => hr_transaction_swi.getDateValue(l_CommitNode,'StartDate')
    ,P_END_DATE                      => hr_transaction_swi.getDateValue(l_CommitNode,'EndDate')
    ,P_EMPLOYEE_NUMBER               => hr_transaction_swi.getVarchar2Value(l_CommitNode,'EmployeeNumber')
    ,P_LEAVING_REASON                => hr_transaction_swi.getVarchar2Value(l_CommitNode,'LeavingReason')
    ,P_LEAVING_PERSON_TYPE_ID        => hr_transaction_swi.getNumberValue(l_CommitNode,'LeavingPersonTypeId')
    ,P_STATUS                        => hr_transaction_swi.getVarchar2Value(l_CommitNode,'Status')
    ,P_STATUS_CHANGE_REASON          => hr_transaction_swi.getVarchar2Value(l_CommitNode,'StatusChangeReason')
    ,P_DEPLYMT_POLICY_ID             => hr_transaction_swi.getNumberValue(l_CommitNode,'DeplymtPolicyId')
    ,P_ORGANIZATION_ID               => hr_transaction_swi.getNumberValue(l_CommitNode,'OrganizationId')
    ,P_LOCATION_ID                   => hr_transaction_swi.getNumberValue(l_CommitNode,'LocationId')
    ,P_JOB_ID                        => hr_transaction_swi.getNumberValue(l_CommitNode,'JobId')
    ,P_POSITION_ID                   => hr_transaction_swi.getNumberValue(l_CommitNode,'PositionId')
    ,P_GRADE_ID                      => hr_transaction_swi.getNumberValue(l_CommitNode,'GradeId')
    ,P_SUPERVISOR_ID                 => hr_transaction_swi.getNumberValue(l_CommitNode,'SupervisorId')
    ,P_SUPERVISOR_ASSIGNMENT_ID      => hr_transaction_swi.getNumberValue(l_CommitNode,'SupervisorAssignmentId')
    ,P_RETAIN_DIRECT_REPORTS         => hr_transaction_swi.getVarchar2Value(l_CommitNode,'RetainDirectReports')
    ,P_PAYROLL_ID                    => hr_transaction_swi.getNumberValue(l_CommitNode,'PayrollId')
    ,P_PAY_BASIS_ID                  => hr_transaction_swi.getNumberValue(l_CommitNode,'PayBasisId')
    ,P_PROPOSED_SALARY               => hr_transaction_swi.getVarchar2Value(l_CommitNode,'ProposedSalary')
    ,P_PEOPLE_GROUP_ID               => hr_transaction_swi.getNumberValue(l_CommitNode,'PeopleGroupId')
    ,P_SOFT_CODING_KEYFLEX_ID        => hr_transaction_swi.getNumberValue(l_CommitNode,'SoftCodingKeyflexId')
    ,P_ASSIGNMENT_STATUS_TYPE_ID     => hr_transaction_swi.getNumberValue(l_CommitNode,'AssignmentStatusTypeId')
    ,P_ASS_STATUS_CHANGE_REASON      => hr_transaction_swi.getVarchar2Value(l_CommitNode,'AssStatusChangeReason')
    ,P_ASSIGNMENT_CATEGORY           => hr_transaction_swi.getVarchar2Value(l_CommitNode,'AssignmentCategory')
    ,P_PER_INFORMATION1              => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation1')
    ,P_PER_INFORMATION2              => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation2')
    ,P_PER_INFORMATION3              => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation3')
    ,P_PER_INFORMATION4              => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation4')
    ,P_PER_INFORMATION5              => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation5')
    ,P_PER_INFORMATION6              => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation6')
    ,P_PER_INFORMATION7              => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation7')
    ,P_PER_INFORMATION8              => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation8')
    ,P_PER_INFORMATION9              => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation9')
    ,P_PER_INFORMATION10             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation10')
    ,P_PER_INFORMATION11             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation11')
    ,P_PER_INFORMATION12             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation12')
    ,P_PER_INFORMATION13             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation13')
    ,P_PER_INFORMATION14             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation14')
    ,P_PER_INFORMATION15             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation15')
    ,P_PER_INFORMATION16             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation16')
    ,P_PER_INFORMATION17             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation17')
    ,P_PER_INFORMATION18             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation18')
    ,P_PER_INFORMATION19             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation19')
    ,P_PER_INFORMATION20             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation20')
    ,P_PER_INFORMATION21             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation21')
    ,P_PER_INFORMATION22             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation22')
    ,P_PER_INFORMATION23             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation23')
    ,P_PER_INFORMATION24             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation24')
    ,P_PER_INFORMATION25             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation25')
    ,P_PER_INFORMATION26             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation26')
    ,P_PER_INFORMATION27             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation27')
    ,P_PER_INFORMATION28             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation28')
    ,P_PER_INFORMATION29             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation29')
    ,P_PER_INFORMATION30             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'PerInformation30')
    ,P_DEPLOYMENT_REASON             => hr_transaction_swi.getVarchar2Value(l_CommitNode,'DeploymentReason')
    ,p_return_status                 => l_return_status);
Line: 1484

        select Information8
        into lv_permanent
        from hr_api_transaction_steps
        where transaction_id=p_transaction_id;
Line: 1536

        select Information1
        into lv_deployment_id
        from hr_api_transaction_steps
        where transaction_id=p_transaction_id;
Line: 1581

        select Information2
        into lv_from_person_id
        from hr_api_transaction_steps
        where transaction_id=p_transaction_id;
Line: 1623

        select Information3
        into lv_to_bg_id
        from hr_api_transaction_steps
        where transaction_id=p_transaction_id;
Line: 1665

        select Information4
        into lv_person_type_id
        from hr_api_transaction_steps
        where transaction_id=p_transaction_id;
Line: 1709

        select to_date(Information5,'YYYY-MM-DD')
        into lv_start_date
        from hr_api_transaction_steps
        where transaction_id=p_transaction_id;
Line: 1753

        select to_date(Information6,'YYYY-MM-DD')
        into lv_end_date
        from hr_api_transaction_steps
        where transaction_id=p_transaction_id;
Line: 1799

        select Information7
        into lv_employee_number
        from hr_api_transaction_steps
        where transaction_id=p_transaction_id;
Line: 1844

        select Information9
        into lv_to_bg_id
        from hr_api_transaction_steps
        where transaction_id=p_transaction_id;
Line: 1889

        select Information10
        into lv_organization_id
        from hr_api_transaction_steps
        where transaction_id=p_transaction_id;
Line: 1932

        select Information11
        into lv_job_id
        from hr_api_transaction_steps
        where transaction_id=p_transaction_id;
Line: 1957

/*FUNCTION -- IS UPDATE ALLOWED  */
/*********************************/



function isUpdateAllowed(p_transaction_id in number,
                         p_person_deployment_id in number,
                         p_deployment_type in Varchar2,
                         p_transaction_status in varchar2) return varchar2

IS
c_proc  constant varchar2(30) := 'isUpdateAllowed';
Line: 1969

lv_UpdateAllowed varchar2(30);
Line: 1986

     			lv_UpdateAllowed := 'UpdateEnabled1';
Line: 1988

     			lv_UpdateAllowed := 'UpdateDisabled';
Line: 1992

     			lv_UpdateAllowed := 'UpdateEnabled1';
Line: 1994

     			lv_UpdateAllowed := 'UpdateDisabled';
Line: 2000

        lv_UpdateAllowed := 'UpdateDisabled';
Line: 2006

  return lv_UpdateAllowed;
Line: 2017

end isUpdateAllowed;
Line: 2021

/*FUNCTION -- IS DELETE ALLOWED  */
/*********************************/



function isDeleteAllowed(p_transaction_id in number,
                         p_person_deployment_id in number,
                         p_deployment_type in Varchar2,
                         p_transaction_status in varchar2) return varchar2

IS
c_proc  constant varchar2(30) := 'isDeleteAllowed';
Line: 2033

lv_DeleteAllowed varchar2(30);
Line: 2050

     			lv_DeleteAllowed := 'DeleteEnabled';
Line: 2054

				lv_DeleteAllowed := 'DeleteEnabled';
Line: 2056

				lv_DeleteAllowed := 'DeleteDisabled';
Line: 2059

     			lv_DeleteAllowed := 'DeleteDisabled';
Line: 2063

     			lv_DeleteAllowed := 'DeleteEnabled';
Line: 2067

				  lv_DeleteAllowed := 'DeleteEnabled';
Line: 2069

			          lv_DeleteAllowed := 'DeleteDisabled';
Line: 2072

     			lv_DeleteAllowed := 'DeleteDisabled';
Line: 2078

     			lv_DeleteAllowed := 'DeleteDisabled';
Line: 2082

  return lv_DeleteAllowed;
Line: 2093

end isDeleteAllowed;
Line: 2223

        select Information12
        into lv_action_mode
        from hr_api_transaction_steps
        where transaction_id=p_transaction_id;
Line: 2271

        select Information12
        into lv_action_mode
        from hr_api_transaction_steps
        where transaction_id=p_transaction_id;
Line: 2283

    	if lv_action_mode in ('CreateMode','UpdateMode','ActUpdateMode') then
    		if p_transaction_status in ('AC') then
    			lv_status := 'APPROVED';
Line: 2340

        select Information13
        into lv_from_person_id
        from hr_api_transaction_steps
        where transaction_id=p_transaction_id;
Line: 2383

        select Information14
        into lv_ovn
        from hr_api_transaction_steps
        where transaction_id=p_transaction_id;
Line: 2433

  	select count(hat.transaction_id)
  	into   lv_transaction_count
  	from   hr_api_transactions hat,
  	       hr_api_transaction_steps hats
  	where  hat.transaction_ref_table='HR_PERSON_DEPLOYMENT'
        and    hats.transaction_id = hat.transaction_id
        and    hats.information1 = to_char(p_deployment_id)
        and    not(hr_person_deployment_swi.getDeploymentType(hat.transaction_id,NULL) IS NULL and hat.status = 'W')
        and    hat.status in ('AC')
        and    not exists ( select 'e'
                            from  hr_api_transactions t,
                                  hr_api_transaction_steps hat
                            WHERE t.transaction_ref_table='HR_PERSON_DEPLOYMENT'
                            and   hat.transaction_id = t.transaction_id
                            and   hat.information1 = to_char(p_deployment_id)
                            and   not(hr_person_deployment_swi.getDeploymentType(t.transaction_id,NULL) IS NULL and t.status = 'W')
                            and   t.status not in ('D','E','AC'));
Line: 2456

        		select ACTION
        		into  lv_action
			from  PQH_SS_APPROVAL_HISTORY
			where transaction_history_id in (select hat.transaction_id
			                                 from   hr_api_transactions hat, hr_api_transaction_steps hats
							 where  hat.transaction_id = hats.transaction_id
							 and    hat.transaction_ref_table='HR_PERSON_DEPLOYMENT'
							 and    hats.information1 = to_char(p_deployment_id)
			                                 and    not(hr_person_deployment_swi.getDeploymentType(hat.transaction_id,NULL) IS NULL and hat.status = 'W') )
			and creation_date = (select max(CREATION_DATE)
			                     from  PQH_SS_APPROVAL_HISTORY
			                     where transaction_history_id in (select hat.transaction_id
			                                                      from   hr_api_transactions hat, hr_api_transaction_steps hats
							                      where  hat.transaction_id = hats.transaction_id
							                      and    hat.transaction_ref_table='HR_PERSON_DEPLOYMENT'
							                      and    hats.information1 = to_char(p_deployment_id)
			                                                      and    not(hr_person_deployment_swi.getDeploymentType(hat.transaction_id,NULL) IS NULL and hat.status = 'W') )
                                             );
Line: 2495

  	select count(hat.transaction_id)
  	into   lv_transaction_count
  	from   hr_api_transactions hat,
  	       hr_api_transaction_steps hats
  	where  hat.transaction_ref_table='HR_PERSON_DEPLOYMENT'
        and    hats.transaction_id = hat.transaction_id
        and    hats.information1 = to_char(p_deployment_id)
        and    not(hr_person_deployment_swi.getDeploymentType(hat.transaction_id,NULL) IS NULL and hat.status = 'W')
        and    hat.status in ('AC')
        and    not exists ( select 'e'
                            from  hr_api_transactions t,
                                  hr_api_transaction_steps hat
                            WHERE t.transaction_ref_table='HR_PERSON_DEPLOYMENT'
                            and   hat.transaction_id = t.transaction_id
                            and   hat.information1 = to_char(p_deployment_id)
                            and   not(hr_person_deployment_swi.getDeploymentType(t.transaction_id,NULL) IS NULL and t.status = 'W')
                            and   t.status not in ('D','E','AC'));
Line: 2520

        		select ACTION
        		into  lv_action
			from  PQH_SS_APPROVAL_HISTORY
			where transaction_history_id in (select hat.transaction_id
			                                 from   hr_api_transactions hat, hr_api_transaction_steps hats
							 where  hat.transaction_id = hats.transaction_id
							 and    hat.transaction_ref_table='HR_PERSON_DEPLOYMENT'
							 and    hats.information1 = to_char(p_deployment_id)
							 and    upper(hats.information12) in ('RETURNMODE','ACTUPDATEMODE')
			                                 and    not(hr_person_deployment_swi.getDeploymentType(hat.transaction_id,NULL) IS NULL and hat.status = 'W') )
			and creation_date = (select max(CREATION_DATE)
			                     from  PQH_SS_APPROVAL_HISTORY
			                     where transaction_history_id in (select hat.transaction_id
			                                                      from   hr_api_transactions hat, hr_api_transaction_steps hats
							                      where  hat.transaction_id = hats.transaction_id
							                      and    hat.transaction_ref_table='HR_PERSON_DEPLOYMENT'
							                      and    hats.information1 = to_char(p_deployment_id)
							                      and    upper(hats.information12) in ('RETURNMODE','ACTUPDATEMODE')
			                                                      and    not(hr_person_deployment_swi.getDeploymentType(hat.transaction_id,NULL) IS NULL and hat.status = 'W') )
                                             );
Line: 2563

  	select count(hat.transaction_id)
  	into   lv_transaction_count
  	from   hr_api_transactions hat,
  	       hr_api_transaction_steps hats
  	where  hat.transaction_ref_table='HR_PERSON_DEPLOYMENT'
        and    hats.transaction_id = hat.transaction_id
        and    hats.information1 = to_char(p_deployment_id)
        and    not(hr_person_deployment_swi.getDeploymentType(hat.transaction_id,NULL) IS NULL and hat.status = 'W')
        and    hat.status in ('AC')
        and    not exists ( select 'e'
                            from  hr_api_transactions t,
                                  hr_api_transaction_steps hat
                            WHERE t.transaction_ref_table='HR_PERSON_DEPLOYMENT'
                            and   hat.transaction_id = t.transaction_id
                            and   hat.information1 = to_char(p_deployment_id)
                            and   not(hr_person_deployment_swi.getDeploymentType(t.transaction_id,NULL) IS NULL and t.status = 'W')
                            and   t.status not in ('D','E','AC'));
Line: 2588

        		select ACTION
        		into  lv_action
			from  PQH_SS_APPROVAL_HISTORY
			where transaction_history_id in (select hat.transaction_id
			                                 from   hr_api_transactions hat, hr_api_transaction_steps hats
							 where  hat.transaction_id = hats.transaction_id
							 and    hat.transaction_ref_table='HR_PERSON_DEPLOYMENT'
							 and    hats.information1 = to_char(p_deployment_id)
							 and    upper(hats.information12) = 'RETURNMODE'
			                                 and    not(hr_person_deployment_swi.getDeploymentType(hat.transaction_id,NULL) IS NULL and hat.status = 'W') )
			and creation_date = (select max(CREATION_DATE)
			                     from  PQH_SS_APPROVAL_HISTORY
			                     where transaction_history_id in (select hat.transaction_id
			                                                      from   hr_api_transactions hat, hr_api_transaction_steps hats
							                      where  hat.transaction_id = hats.transaction_id
							                      and    hat.transaction_ref_table='HR_PERSON_DEPLOYMENT'
							                      and    hats.information1 = to_char(p_deployment_id)
							                      and    upper(hats.information12) = 'RETURNMODE'
			                                                      and    not(hr_person_deployment_swi.getDeploymentType(hat.transaction_id,NULL) IS NULL and hat.status = 'W') )
                                             );
Line: 2665

        		select ACTION
        		into  lv_action
			from  PQH_SS_APPROVAL_HISTORY
			where transaction_history_id = p_transaction_id
			and creation_date = (select max(CREATION_DATE)
			                     from  PQH_SS_APPROVAL_HISTORY
			                     where transaction_history_id = p_transaction_id)
      -- and upper('ACTUPDATEMODE') NOT IN (SELECT UPPER(information12) from hr_api_transaction_steps where transaction_step_id = p_transaction_step_id)
     -- and upper('RETURNMODE') NOT IN (SELECT UPPER(information12) from hr_api_transaction_steps where transaction_step_id = p_transaction_step_id)
     -- and upper('UPDATEMODE') NOT IN (SELECT UPPER(information12) from hr_api_transaction_steps where transaction_step_id = p_transaction_step_id)
     and (SELECT UPPER(information12) from hr_api_transaction_steps where transaction_step_id = p_transaction_step_id) not in ('ACTUPDATEMODE','RETURNMODE','UPDATEMODE');
Line: 2914

						select item_type,item_key
            into l_item_type,l_item_key
            from hr_api_transactions
            where transaction_id = p_transaction_id;