DBA Data[Home] [Help]

APPS.HR_APPROVAL_SS SQL Statements

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

Line: 20

    select 1
    from   wf_item_attribute_values wiav
    where  wiav.item_type = p_item_type
    and    wiav.item_key  = p_item_key
    and    wiav.name      = p_name;
Line: 139

           SELECT process_activity
           into ln_activity_id
           from
              (select process_activity
                FROM   WF_ITEM_ACTIVITY_STATUSES IAS
                WHERE  ias.item_type          = p_item_type
                 and    ias.item_key           = p_item_key
                 and    ias.activity_status    = 'NOTIFIED'
                 and    ias.process_activity   in (
                                                 select  wpa.instance_id
                                                 FROM    WF_PROCESS_ACTIVITIES     WPA,
                                                         WF_ACTIVITY_ATTRIBUTES    WAA,
                                                         WF_ACTIVITIES             WA,
                                                         WF_ITEMS                  WI
                                                 WHERE   wpa.process_item_type   = ias.item_type
                                                 and     wa.item_type           = wpa.process_item_type
                                                 and     wa.name                = wpa.activity_name
                                                 and     wi.item_type           = ias.item_type
                                                 and     wi.item_key            = ias.item_key
                                                 and     wi.begin_date         >= wa.begin_date
                                                 and     wi.begin_date         <  nvl(wa.end_date,wi.begin_date+1)
                                                 and     waa.activity_item_type  = wa.item_type
                                                 and     waa.activity_name       = wa.name
                                                 and     waa.activity_version    = wa.version
                                                 and     waa.type                = 'FORM'
                                               )
               order by begin_date desc)
           where rownum<=1;
Line: 218

        select text_value
        into lv_result_code
        from wf_notification_attributes
        where notification_id=wf_engine.context_nid
        and name='RESULT';
Line: 235

        select text_value
        into lv_comments
        from wf_notification_attributes
        where notification_id=wf_engine.context_nid
        and name='WF_NOTE';
Line: 252

        DEL		:Delete
        REJECTED	:Reject
        RESUBMIT	:Resubmit
        RETURNEDFORCORRECTION:Return for Correction
        SFL		:Saved For Later
        START		:Start Over
        TIMEOUT		:Timeout/No response

    */
    -- block update the approval action history
    begin
        if(lv_result_code ='APPROVED') then
           if g_debug then
              hr_utility.set_location('calling hr_trans_history_api.archive_approve',4);
Line: 307

              hr_utility.set_location('calling hr_trans_history_api.archive_delete',7);
Line: 310

           hr_trans_history_api.archive_delete(c_transaction_id,
                                            wf_engine.context_nid,
                                            wf_engine.context_user,
                                            lv_comments);
Line: 364

        select RECIPIENT_ROLE
        into lv_recipient
        from wf_notifications
        where notification_id=wf_engine.context_nid;
Line: 857

 IF lv_exists <>'N' AND lv_isvalid <>'DELETED' THEN
      l_forward_to_person_id :=
          wf_engine.GetItemAttrNumber
                       (itemtype    => p_item_type,
                        itemkey     => p_item_key,
                        aname       => lv_item_name
                        );
Line: 1021

                      aname=>'HR_APR_API_INSERTION_ATTR',
                      text_value=>p_approverRec.api_insertion,
                      number_value=>null,
                      date_value=>null);
Line: 1566

procedure updateApprovalHistory( p_item_type    in varchar2,
                           p_item_key     in varchar2,
                           p_act_id       in number,
                           funmode     in varchar2,
                           result      out nocopy varchar2     )

is
  -- local variables
   c_proc constant varchar2(30) := 'updateApprovalHistory';
Line: 1615

end updateApprovalHistory;
Line: 1655

procedure updateApproveStatus( p_item_type    in varchar2,
                           p_item_key     in varchar2,
                           p_act_id       in number,
                           funmode     in varchar2,
                           result      out nocopy varchar2     )

is
  -- local variables
   c_proc constant varchar2(30) := 'updateApproveStatus';
Line: 1702

	    hr_utility.set_location('calling ame_api2.updateApprovalStatus2', 3);
Line: 1710

	  ame_api2.updateApprovalStatus2(applicationIdIn=>c_application_id,
                                   transactionTypeIn =>c_transaction_type,
                                   transactionIdIn=>c_transaction_id,
                                   approvalStatusIn =>ame_util.approvedStatus,
                                   approverNameIn =>l_current_forward_to_username,
                                   itemClassIn => null,
                                   itemIdIn =>null,
                                   actionTypeIdIn=> null,
                                   groupOrChainIdIn =>null,
                                   occurrenceIn =>null,
                                   forwardeeIn =>ame_util.emptyApproverRecord2,
                                  updateItemIn =>false);
Line: 1725

                hr_utility.set_location('Error in  updateApproveStatus SQLERRM' ||' '||to_char(SQLCODE),10);
Line: 1733

	    hr_utility.set_location('returned from calling ame_api2.updateApprovalStatus2', 8);
Line: 1744

           updateApprovalHistory( p_item_type=>p_item_type,
                           p_item_key=>p_item_key,
                           p_act_id=>p_act_id,
                           funmode=>funmode,
                           result=>result);*/
Line: 1759

                hr_utility.set_location('Error in  updateApproveStatus SQLERRM' ||' '||to_char(SQLCODE),30);
Line: 1762

end updateApproveStatus;
Line: 1866

		    hr_utility.set_location('calling  ame_api2.updateApprovalStatus2', 2);
Line: 1874

	         ame_api2.updateApprovalStatus2(applicationIdIn=>c_application_id,
                                   transactionTypeIn =>c_transaction_type,
                                   transactionIdIn=>c_transaction_id,
                                   approvalStatusIn =>ame_util.notifiedStatus,
                                   approverNameIn =>l_current_forward_to_username,
                                   itemClassIn => wf_engine.GetItemAttrText(itemtype => p_item_type ,
                                               itemkey  => p_item_key,
                                               aname => 'HR_APR_ITEM_CLASS_ATTR'),
                                   -- HR_APR_ITEM_ID_ATTR
                                   itemIdIn =>wf_engine.GetItemAttrText(itemtype => p_item_type ,
                                               itemkey  => p_item_key,
                                               aname => 'HR_APR_ITEM_ID_ATTR'),
                                   -- HR_APR_ACTION_TYPE_ID_ATTR
                                   actionTypeIdIn=> wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
                                               itemkey  => p_item_key,
                                               aname => 'HR_APR_ACTION_TYPE_ID_ATTR'),
                                   -- HR_APR_GRPORCHN_ID_ATTR
                                   groupOrChainIdIn =>wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
                                               itemkey  => p_item_key,
                                               aname => 'HR_APR_GRPORCHN_ID_ATTR'),
                                   occurrenceIn =>null,
                                   forwardeeIn =>ame_util.emptyApproverRecord2,
                                  updateItemIn =>false);
Line: 1917

procedure updateNoResponseStatus( p_item_type    in varchar2,
                           p_item_key     in varchar2,
                           p_act_id       in number,
                           funmode     in varchar2,
                           result      out nocopy varchar2     )

is
  -- local variables
   c_proc constant varchar2(30) := 'updateNoResponseStatus';
Line: 1959

		    hr_utility.set_location('calling  ame_api2.updateApprovalStatus2', 2);
Line: 1967

	       ame_api2.updateApprovalStatus2(applicationIdIn=>c_application_id,
                                   transactionTypeIn =>c_transaction_type,
                                   transactionIdIn=>c_transaction_id,
                                   approvalStatusIn =>ame_util.noResponseStatus,
                                   approverNameIn =>l_current_forward_to_username,
                                   itemClassIn => null,
                                   itemIdIn =>null,
                                   actionTypeIdIn=> null,
                                   groupOrChainIdIn =>null,
                                   occurrenceIn =>null,
                                   forwardeeIn =>ame_util.emptyApproverRecord2,
                                  updateItemIn =>false);
Line: 1993

end updateNoResponseStatus;
Line: 2277

        select text_value
        into lv_result_code
        from wf_notification_attributes
        where notification_id=wf_engine.context_nid
        and name='RESULT';
Line: 2347

   select orig_system,orig_system_id,display_name from wf_roles where name = wf_engine.context_new_role;
Line: 2350

   select last_name,first_name from per_all_people_f where
   person_id = l_new_fwd_person_id;*/
Line: 2381

	    hr_utility.set_location('calling ame_api2.updateApprovalStatus2', 3);
Line: 2405

    ame_api2.updateApprovalStatus2(applicationIdIn=>c_application_id,
                                   transactionTypeIn =>c_transaction_type,
                                   transactionIdIn=>c_transaction_id,
                                   approvalStatusIn =>ame_util.forwardStatus,
                                   approverNameIn =>l_current_forward_to_username,
                                   itemClassIn => null,
                                   itemIdIn =>null,
                                   actionTypeIdIn=> null,
                                   groupOrChainIdIn =>null,
                                   occurrenceIn =>null,
                                   forwardeeIn =>rec_forwardee,
                                  updateItemIn =>false);
Line: 2444

                hr_utility.set_location('Error in  updateApproveStatus SQLERRM' ||' '||to_char(SQLCODE),10);
Line: 2452

	    hr_utility.set_location('returned from calling ame_api2.updateApprovalStatus2', 8);
Line: 2613

		    hr_utility.set_location('calling  ame_api2.updateApprovalStatus2', 2);
Line: 2621

            ame_api2.updateApprovalStatus2(applicationIdIn=>c_application_id,
                                   transactionTypeIn =>c_transaction_type,
                                   transactionIdIn=>c_transaction_id,
                                   approvalStatusIn =>null,
                                   approverNameIn =>c_all_approvers(i).name,
                                   itemClassIn => c_all_approvers(i).ITEM_CLASS,
                                   itemIdIn =>c_all_approvers(i).ITEM_ID,
                                   actionTypeIdIn=> c_all_approvers(i).ACTION_TYPE_ID,
                                   groupOrChainIdIn =>c_all_approvers(i).GROUP_OR_CHAIN_ID,
                                   occurrenceIn =>c_all_approvers(i).OCCURRENCE,
                                   forwardeeIn =>ame_util.emptyApproverRecord2,
                                   updateItemIn =>false);
Line: 3056

      select creator_person_id
      into lv_creator_person_id
      from hr_api_transactions
      where transaction_id=p_transaction_id;
Line: 3070

      select business_group_id
      into lv_businessGroupId
      from per_all_people_f
      where person_id=p_orig_system_id
      and sysdate between effective_start_date and effective_end_date;
Line: 3108

    select original_recipient
    into lv_user_name
    from wf_notifications
    where notification_id =p_notification_id;
Line: 3142

    select original_recipient
    into lv_user_name
    from wf_notifications
    where notification_id =p_notification_id;
Line: 3183

   SELECT 'X'
     FROM wf_item_attribute_values
    WHERE item_type = p_item_Type
      AND item_key  = p_item_Key
      AND name      like 'ADDITIONAL_APPROVER_%'
      AND number_value = p_rfcUserOrigSystemId;
Line: 3194

  SELECT pth.employee_id
    FROM pqh_ss_approval_history pah,
         fnd_user pth
   WHERE pah.user_name = pth.user_name
     AND pah.transaction_history_id = p_transaction_id
     AND approval_history_id = (
      SELECT MAX(approval_history_id)
        FROM pqh_ss_approval_history  pah1,
             fnd_user pth1
       WHERE pah1.user_name = pth1.user_name
         AND pah1.transaction_history_id = pah.transaction_history_id
         AND pth1.employee_id IN (
           SELECT pth2.employee_id --, pth2.user_name, approval_history_id
             FROM pqh_ss_approval_history pah2,
                  fnd_user                pth2
            WHERE pah2.user_name = pth2.user_name
              AND pah2.transaction_history_id = pah.transaction_history_id
              AND approval_history_id < (
               SELECT MIN(approval_history_id)
                 FROM pqh_ss_approval_history
                WHERE transaction_history_id = pah.transaction_history_id
                  AND user_name = lv_role_name
                  AND approval_history_id > 0
               )
           and approval_history_id > 0
           MINUS
           SELECT number_value
             FROM wf_item_attribute_values
            WHERE item_type = p_item_Type
              AND item_key  = p_item_Key
              AND name      like 'ADDITIONAL_APPROVER_%'
      )
    );
Line: 3337

        SELECT ias.notification_id
        into   ln_rfc_notification_id
        FROM   WF_ITEM_ACTIVITY_STATUSES IAS
        WHERE ias.item_type        = p_item_Type
        and   ias.item_key         = p_item_Key
        and   IAS.ACTIVITY_STATUS  = 'NOTIFIED'
        and   notification_id is not null
        and   rownum < 2;
Line: 3390

                    select employee_id into lv_role_orig_sys_id from (
                        SELECT pth.employee_id
                        FROM pqh_ss_approval_history pah,
                             fnd_user pth
                        WHERE pah.user_name = pth.user_name
                        AND pah.transaction_history_id = p_transaction_id
                        and approval_history_id > 0
                        and approval_history_id = (select min(approval_history_id) from pqh_ss_approval_history where USER_NAME = p_rfcRoleName and transaction_history_id = p_transaction_id)
                        and pah.last_update_date <(select min(last_update_date) from pqh_ss_approval_history where USER_NAME = p_rfcRoleName and transaction_history_id = p_transaction_id
                                and approval_history_id = (select min(approval_history_id) from pqh_ss_approval_history where USER_NAME = p_rfcRoleName and transaction_history_id = p_transaction_id))
                        order by pah.last_update_date desc
                        )
                        where rownum = 1;
Line: 3661

    select MAIN_APPRAISER_ID,APPRAISER_PERSON_ID,APPRAISEE_PERSON_ID
    into   l_main_appraiser_id, l_appraiser_person_id,l_appraisee_person_id
    from per_appraisals
    where APPRAISAL_ID=l_appraisal_id;
Line: 3749

         select substr(context,1,instr(context,':',1)-1) itemtype
          ,substr(context,instr(context,':')+1, (
          instr(context,':',instr(context,':')+1 ) - instr(context,':')-1) ) itemkey
          into lv_item_type,lv_item_key
         from   wf_notifications
         where  notification_id   = p_notification_id;
Line: 3761

         select item_type,item_key
         into lv_item_type,lv_item_key
         from hr_api_transactions
         where transaction_id=p_transaction_id;
Line: 3851

    select wrpv.display_name
    from   wf_runnable_processes_v wrpv
    where  wrpv.item_type    = p_item_type
    and    wrpv.process_name = p_process_name;
Line: 3977

  is   select full_name
         from per_all_people_f papf
        where papf.person_id = p_person_id
          and trunc(sysdate) between effective_start_date
          and effective_end_date;
Line: 4037

        select *
        into lr_transaction_rec
        from hr_api_transactions
        where transaction_id=p_transaction_id;
Line: 4070

             select hr_workflow_item_key_s.nextval
             into   p_item_key
             from   sys.dual;
Line: 4133

        ,p_service_orig_sys_id =>lr_transaction_rec.selected_person_id
        ,p_service_orig_sys  =>'PER' -- need to revisit for role based support
        );
Line: 4301

         select * into lr_hr_api_transaction_rec
         from hr_api_transactions
         where transaction_id=p_transaction_id;
Line: 4352

         select * into lr_hr_api_transaction_rec
         from hr_api_transactions
         where transaction_id=p_transaction_id;
Line: 4356

         select notification_id
         into ln_notification_id
         FROM   WF_ITEM_ACTIVITY_STATUSES IAS
         WHERE  ias.item_type          = lr_hr_api_transaction_rec.item_type
         and    ias.item_key           = lr_hr_api_transaction_rec.item_key
         and    ias.activity_status    = 'NOTIFIED'
         and    ias.notification_id is not null
         and rownum<=1;
Line: 4388

         select * into lr_hr_api_transaction_rec
         from hr_api_transactions
         where transaction_id=p_transaction_id;
Line: 4392

         hr_transaction_api.update_transaction(
               p_transaction_id    => p_transaction_id,
               p_status            => 'Y',
               p_transaction_state => null);
Line: 4451

procedure update_comments(
          p_ntf_id  in number,
          p_txn_status in varchar2,
          p_approval_comments     in varchar2)
          is
          cursor csr_wf_note_exists is
          select 1
          from wf_notification_attributes wna
          where notification_id = p_ntf_id
          and NAME = 'WF_NOTE';
Line: 4482

end update_comments;
Line: 4505

         select * into lr_hr_api_transaction_rec
         from hr_api_transactions
         where transaction_id=p_transaction_id;
Line: 4509

             hr_transaction_api.update_transaction(
               p_transaction_id    => p_transaction_id,
               p_status            => 'Y',
               p_transaction_state => null);
Line: 4547

              update_comments(ln_notification_id,lr_hr_api_transaction_rec.status,p_approval_comments);
Line: 4580

             hr_transaction_api.update_transaction(
               p_transaction_id    => p_transaction_id,
               p_status            => 'Y');
Line: 4642

         select item_type,item_key
          into lv_item_type,lv_item_key
         from hr_api_transactions
         where transaction_id=p_transaction_id;
Line: 4723

       select * into lr_hr_api_transaction_rec
       from hr_api_transactions
       where transaction_id=p_transaction_id;
Line: 4796

       select status,transaction_state
       into lv_status,lv_state
       from hr_api_transactions
       where transaction_id=p_transaction_id;