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: 658

select display_name into l_current_forward_to_disp_name from wf_roles where name = l_current_forward_to_username;
Line: 966

 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: 1130

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

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

        SELECT 'Y'
        FROM   wf_local_roles
        WHERE  name = p_role_name;
Line: 1826

        select user_name
        from wf_user_roles
        where role_name = p_role_name;
Line: 2100

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: 2149

end updateApprovalHistory;
Line: 2189

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: 2216

        select *
        from wf_user_roles
        where role_name = p_role_name;
Line: 2264

      select ORIGINAL_RECIPIENT into original_forward_to_user from wf_notifications where notification_id = notification_rec.notification_id;
Line: 2316

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

      hr_utility.set_location('before update AME: ' || l_current_forward_to_username,111);
Line: 2328

	  ame_api6.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,
                                   notificationIn => notification_rec,
                                   forwardeeIn =>ame_util.emptyApproverRecord2,
								   updateItemIn =>false);
Line: 2362

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

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

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

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

end updateApproveStatus;
Line: 2525

                     ame_api2.updateApprovalStatus2(applicationIdIn=>c_application_id,
                                   transactionTypeIn =>c_transaction_type,
                                   transactionIdIn=>c_transaction_id,
                                   approvalStatusIn =>ame_util.notifiedStatus,
                                   approverNameIn =>c_next_approvers(l_index).name,
                                   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: 2567

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

	         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: 2619

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: 2638

        select *
        from wf_user_roles
        where role_name = p_role_name;
Line: 2696

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

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

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

	       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: 2776

end updateNoResponseStatus;
Line: 3062

   SELECT transaction_ref_table, transaction_ref_id
   FROM   hr_api_transactions
   WHERE  transaction_id  = p_txn_id;
Line: 3077

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

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

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

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

    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: 3280

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

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

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

            ame_api6.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,
                                   notificationIn => notification_rec,
                                   forwardeeIn =>ame_util.emptyApproverRecord2,
                                   updateItemIn =>false);
Line: 3582

					            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: 4067

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

      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: 4119

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

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

   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: 4205

  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: 4348

        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: 4401

                    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: 4688

    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: 4776

         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: 4788

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

    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: 5018

  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: 5078

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

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

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

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

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

         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: 5429

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

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

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: 5523

end update_comments;
Line: 5546

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

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

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

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

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

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

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

procedure updateRejectStatus( 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) := 'updateRejectStatus';
Line: 6006

        select *
        from wf_user_roles
        where role_name = p_role_name;
Line: 6021

	select transaction_ref_table into l_trans_ref_table
    from hr_api_transactions
    where item_type = p_item_type and item_key = p_item_key;
Line: 6074

       select ORIGINAL_RECIPIENT into original_forward_to_user from wf_notifications where notification_id = notification_rec.notification_id;
Line: 6128

	    hr_utility.set_location('calling ame_api6.updateApproveStatus2 with Reject status', 3);
Line: 6136

	  ame_api6.updateApprovalStatus2(applicationIdIn=>c_application_id,
                                   transactionTypeIn =>c_transaction_type,
                                   transactionIdIn=>c_transaction_id,
                                   approvalStatusIn =>ame_util.rejectStatus,
                                   approverNameIn =>l_current_forward_to_username,
                                   itemClassIn => null,
                                   itemIdIn => null,
                                   actionTypeIdIn=> null,
                                   groupOrChainIdIn => null,
                                   occurrenceIn => null,
                                   notificationIn => notification_rec,
                                   forwardeeIn =>ame_util.emptyApproverRecord2,
                                  updateItemIn =>false);
Line: 6153

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

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

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

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

end updateRejectStatus;
Line: 6207

  select lower(meaning) into toString from hr_lookups where LOOKUP_TYPE = 'BEN_TO_FROM' and lookup_code = 'TO';