DBA Data[Home] [Help]

APPS.POR_AME_REQ_WF_PVT SQL Statements

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

Line: 13

PROCEDURE UpdateActionHistory(p_document_id      NUMBER,
                              p_action           VARCHAR2,
                              p_note             VARCHAR2,
                              p_current_approver NUMBER);
Line: 62

  l_insertion_type            VARCHAR2(30);
Line: 77

           PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 109

          PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 134

                      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_doc_string);
Line: 145

              PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 154

                PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 159

                PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 202

           PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_doc_string);
Line: 278

           PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 297

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 300

        SELECT
            to_char(l_document_id) || '-' || to_char(PO_WF_ITEMKEY_S.nextval)
        INTO l_item_key
        FROM sys.dual;
Line: 421

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 431

            select first_position_id, first_approver_id
            into l_first_position_id, l_first_approver_id
            from po_requisition_headers_all
            where l_document_id = requisition_header_id;
Line: 440

              SELECT full_name
              INTO l_next_approver_name
              FROM per_all_people_f person
              WHERE person_id = l_first_approver_id
            --Bug#7207213#This query fetches multiple records so adding a filter
              and trunc(sysdate) between person.effective_start_date and nvl(person.effective_end_date, trunc(sysdate));
Line: 451

              SELECT person_id, full_name into l_next_approver_id,l_next_approver_name FROM (
                       SELECT person.person_id, person.full_name FROM per_all_people_f person, per_all_assignments_f asg
                       WHERE asg.position_id = g_next_approvers(l_approver_index).orig_system_id and trunc(sysdate) between person.effective_start_date
                       and nvl(person.effective_end_date, trunc(sysdate)) and person.person_id = asg.person_id
                       and asg.primary_flag = 'Y' and asg.assignment_type in ('E','C')
                       and ( person.current_employee_flag = 'Y' or person.current_npw_flag = 'Y' )
                       and asg.assignment_status_type_id not in (
                          SELECT assignment_status_type_id FROM per_assignment_status_types
                          WHERE per_system_status = 'TERM_ASSIGN'
                       ) and trunc(sysdate) between asg.effective_start_date and asg.effective_end_date order by person.last_name
              ) where rownum = 1;
Line: 471

            SELECT employee_id
               into l_next_approver_id
            FROM fnd_user
            WHERE user_id = g_next_approvers(l_approver_index).orig_system_id
               and trunc(sysdate) between start_date and nvl(end_date, sysdate+1);
Line: 486

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 507

            po_wf_debug_pkg.insert_debug(itemtype,itemkey,l_progress);
Line: 565

        if (g_next_approvers(l_approver_index).api_insertion = 'Y') then
	  n_varval(5) := 1;
Line: 583

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 598

      g_next_approvers.delete;
Line: 612

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_doc_string );
Line: 623

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_doc_string );
Line: 670

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 687

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 707

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 720

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 727

         SELECT name into l_current_approver.name FROM
             ( SELECT name FROM wf_roles WHERE orig_system = l_current_approver.orig_system
                 and orig_system_id = l_current_approver.orig_system_id
                 order by start_date
              )
         WHERE rownum = 1;
Line: 741

    ame_api2.updateApprovalStatus( applicationIdIn=>applicationId,
                                   transactionIdIn=>l_document_id,
                                   transactionTypeIn=>l_transaction_type,
                                   approverIn => l_current_approver);
Line: 754

       SELECT parent_item_type, parent_item_key
          into l_parent_item_type, l_parent_item_key
       FROM wf_items
       WHERE item_type = itemtype and item_key = itemkey;
Line: 823

        SELECT wfi.item_type, wfi.item_key
        FROM wf_items wfi,wf_item_activity_statuses wfias
        WHERE wfi.parent_item_key =itemkey
        and wfi.item_type=itemtype
        AND wfias.item_type=wfi.item_type
        AND wfias.item_key=wfi.item_key
        AND wfias.activity_status='NOTIFIED'
        AND wfias.notification_id IS NOT null;
Line: 837

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 840

    SELECT parent_item_type, parent_item_key
        into l_parent_item_type, l_parent_item_key
    FROM wf_items
    WHERE item_type = itemtype and item_key = itemkey;
Line: 863

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 878

    select first_position_id, first_approver_id
    into l_first_position_id, l_first_approver_id
    from po_requisition_headers_all
    where l_req_header_id = requisition_header_id;
Line: 885

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 894

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 909

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 917

          PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 919

          PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, approverList(i).orig_system || to_char(i) || ' ' ||
                                                         approverList(i).orig_system_id);
Line: 921

          PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'authority' || ' ' || approverList(i).authority);
Line: 922

          PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'approval_status'|| ' ' || approverList(i).approval_status);
Line: 923

          PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'api_insertion'|| ' ' || approverList(i).api_insertion);
Line: 924

          PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'group_or_chain_id' || ' ' || approverList(i).group_or_chain_id);
Line: 929

            and approverList(i).api_insertion = ame_util.oamGenerated
            and approverList(i).group_or_chain_id = l_approver_group_id) then

            l_orig_system     := approverList(i).orig_system;
Line: 949

              SELECT person_id into l_person_id FROM (
                       SELECT person.person_id FROM per_all_people_f person, per_all_assignments_f asg
                       WHERE asg.position_id = l_orig_system_id and trunc(sysdate) between person.effective_start_date
                       and nvl(person.effective_end_date, trunc(sysdate)) and person.person_id = asg.person_id
                       and asg.primary_flag = 'Y' and asg.assignment_type in ('E','C')
                       and ( person.current_employee_flag = 'Y' or person.current_npw_flag = 'Y' )
                       and asg.assignment_status_type_id not in (
                          SELECT assignment_status_type_id FROM per_assignment_status_types
                          WHERE per_system_status = 'TERM_ASSIGN'
                       ) and trunc(sysdate) between asg.effective_start_date and asg.effective_end_date order by person.last_name
                ) where rownum = 1;
Line: 971

             SELECT employee_id into l_person_id
             FROM fnd_user
             WHERE user_id = l_orig_system_id
             and trunc(sysdate) between start_date and nvl(end_date, sysdate+1);
Line: 1007

          UpdateActionHistory(l_req_header_id, 'NO ACTION',
                            l_note, l_person_id);
Line: 1019

	   -- Get the approver id as the person id to update the action history
	   l_person_id := po_wf_util_pkg.GetItemAttrNumber( itemtype => l_child_wf_cur.item_type,
                                                            itemkey  => l_child_wf_cur.item_key,
                                                            aname    => 'APPROVER_EMPID');
Line: 1026

             PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1034

	   -- update the action history table
           UpdateActionHistory(l_req_header_id, 'NO ACTION',
                                        l_note, l_person_id);
Line: 1040

             PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1051

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1112

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1115

    SELECT parent_item_type, parent_item_key
        into l_parent_item_type, l_parent_item_key
    FROM wf_items
    WHERE item_type = itemtype and item_key = itemkey;
Line: 1173

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1219

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1224

    SELECT parent_item_type, parent_item_key
        into l_parent_item_type, l_parent_item_key
    FROM wf_items
    WHERE item_type = itemtype and item_key = itemkey;
Line: 1285

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1334

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1339

    SELECT parent_item_type, parent_item_key
        into l_parent_item_type, l_parent_item_key
    FROM wf_items
    WHERE item_type = itemtype and item_key = itemkey;
Line: 1405

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1437

procedure insertActionHistory( p_req_header_id in number,
                               p_employee_id in number,
                               p_approval_group_id in number)

is
pragma AUTONOMOUS_TRANSACTION;
Line: 1456

  SELECT max(sequence_num)
  INTO l_sequence_num
  FROM PO_ACTION_HISTORY
  WHERE object_type_code = 'REQUISITION'
      AND object_id = p_req_header_id;
Line: 1462

  SELECT object_sub_type_code,
          object_revision_num, approval_path_id, request_id,
          program_application_id, program_date, program_id
  INTO l_object_sub_type_code,
          l_object_revision_num, l_approval_path_id, l_request_id,
          l_program_application_id, l_program_date, l_program_id
  FROM PO_ACTION_HISTORY
  WHERE object_type_code = 'REQUISITION'
     AND object_id = p_req_header_id
     AND sequence_num = l_sequence_num;
Line: 1473

       /* update po action history */
           po_forward_sv1.insert_action_history (
      	   p_req_header_id,
      	   'REQUISITION',
     	   l_object_sub_type_code,
     	   l_sequence_num + 1,
     	   NULL,
     	   NULL,
     	   p_employee_id,
     	   NULL,
     	   NULL,
		l_object_revision_num,
		NULL,                  /* offline_code */
		l_request_id,
		l_program_application_id,
		l_program_id,
		l_program_date,
     	   fnd_global.user_id,
     	   fnd_global.login_id,
           p_approval_group_id);
Line: 1496

end insertActionHistory;
Line: 1520

procedure Insert_Action_History( itemtype        in varchar2,
                                 itemkey         in varchar2,
                                 actid           in number,
                                 funcmode        in varchar2,
                                 resultout       out NOCOPY varchar2) IS

  l_progress                  VARCHAR2(500) := '000';
Line: 1539

    l_progress := 'Insert_Action_History: 001';
Line: 1541

         PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 1569

        l_progress := 'Insert_Action_History: 004 - Calling insertActionHistory.';
Line: 1570

        insertActionHistory(l_req_header_id, l_next_approver_id, l_approval_group_id);
Line: 1572

        l_progress := 'Insert_Action_History: 005 - Done with insertActionHistory.';
Line: 1574

             PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 1594

    l_progress := 'Insert_Action_History: 999';
Line: 1596

       /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 1603

    wf_core.context('POR_AME_REQ_WF_PVT','Insert_Action_History',l_progress,sqlerrm);
Line: 1604

    PO_REQAPPROVAL_INIT1.send_error_notif(itemType, itemkey, l_preparer_user_name, l_doc_string, sqlerrm, 'POR_AME_REQ_WF_PVT.INSERT_ACTION_HISTORY');
Line: 1606

 END Insert_Action_History;
Line: 1630

procedure Update_Action_History_Approve( itemtype        in varchar2,
                                         itemkey         in varchar2,
                                         actid           in number,
                                         funcmode        in varchar2,
                                         resultout       out NOCOPY varchar2) IS
  l_progress                  VARCHAR2(500) := '000';
Line: 1653

    l_progress := 'Update_Action_History_Approve: 001';
Line: 1655

       /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 1689

        l_progress := 'Update_Action_History_Approve: 002-'|| to_char(l_document_id)||'-'||
                           l_document_type||'-'||l_document_subtype;
Line: 1692

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 1695

        UpdateActionHistory(l_document_id, l_action,
                            l_note, l_current_approver);
Line: 1707

    l_progress := 'Update_Action_History_Approve: 003';
Line: 1709

       /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 1717

    wf_core.context('POR_AME_REQ_WF_PVT','Update_Action_History_Approve',l_progress,sqlerrm);
Line: 1718

    PO_REQAPPROVAL_INIT1.send_error_notif(itemType, itemkey, l_preparer_user_name, l_doc_string, sqlerrm, 'POR_AME_REQ_WF_PVT.UPDATE_ACTION_HISTORY_APPROVE');
Line: 1721

END Update_Action_History_Approve;
Line: 1745

procedure Update_Action_History_Reject(itemtype        in varchar2,
                                itemkey         in varchar2,
                                actid           in number,
                                funcmode        in varchar2,
                                resultout       out NOCOPY varchar2) IS

  l_progress                  VARCHAR2(100) := '000';
Line: 1769

    l_progress := 'Update_Action_History_Reject: 001';
Line: 1771

       /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 1805

        l_progress := 'Update_Action_History_Reject: 002-'|| to_char(l_document_id)||'-'||
                           l_document_type||'-'||l_document_subtype;
Line: 1808

             PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 1811

        UpdateActionHistory(l_document_id, l_action,
                            l_note, l_current_approver);
Line: 1823

    l_progress := 'Update_Action_History_Reject: 003';
Line: 1825

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 1832

    wf_core.context('POR_AME_REQ_WF_PVT','Update_Action_History_Reject',l_progress,sqlerrm);
Line: 1833

    PO_REQAPPROVAL_INIT1.send_error_notif(itemType, itemkey, l_preparer_user_name, l_doc_string, sqlerrm, 'POR_AME_REQ_WF_PVT.Update_Action_History_Reject');
Line: 1836

END Update_Action_History_Reject;
Line: 1860

procedure Update_Action_History_Timeout(itemtype        in varchar2,
                                itemkey         in varchar2,
                                actid           in number,
                                funcmode        in varchar2,
                                resultout       out NOCOPY varchar2) IS

  l_progress                  VARCHAR2(100) := '000';
Line: 1884

    l_progress := 'Update_Action_History_Timeout: 001';
Line: 1886

       /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 1918

        l_progress := 'Update_Action_History_Timeout: 002-'|| to_char(l_document_id)||'-'||
                           l_document_type||'-'||l_document_subtype;
Line: 1922

             PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 1925

        UpdateActionHistory(l_document_id, l_action,
                            l_note, l_current_approver);
Line: 1932

    l_progress := 'Update_Action_History_Timeout: 003';
Line: 1934

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 1941

    wf_core.context('POR_AME_REQ_WF_PVT','Update_Action_History_Timeout',l_progress,sqlerrm);
Line: 1942

    PO_REQAPPROVAL_INIT1.send_error_notif(itemType, itemkey, l_preparer_user_name, l_doc_string, sqlerrm, 'POR_AME_REQ_WF_PVT.Update_Action_History_Timeout');
Line: 1945

END Update_Action_History_Timeout;
Line: 1968

procedure Update_Action_History_No_Act (itemtype        in varchar2,
                                    itemkey         in varchar2,
                                    actid           in number,
                                    funcmode        in varchar2,
                                    resultout       out NOCOPY varchar2    ) is
l_doc_header_id         NUMBER;
Line: 1984

    x_progress := 'POR_AME_REQ_WF_PVT.Update_Action_History_No_Act: 01';
Line: 2019

    x_progress := 'POR_AME_REQ_WF_PVT.Update_Action_History_No_Act: 02 - l_doc_header_id ' || l_doc_header_id || ' -- l_doc_type :' || l_doc_type ;
Line: 2022

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 2029

         UpdateActionHistory(l_doc_header_id, 'NO ACTION', l_note, NULL);
Line: 2035

    x_progress := 'POR_AME_REQ_WF_PVT.Update_Action_History_No_Act: 03';
Line: 2037

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 2044

    wf_core.context('POR_AME_REQ_WF_PVT','Update_Action_History_No_Act',x_progress);
Line: 2045

    PO_REQAPPROVAL_INIT1.send_error_notif(itemType, itemkey, l_preparer_user_name, l_doc_string, sqlerrm, 'POR_AME_REQ_WF_PVT.Update_Action_History_No_Act');
Line: 2047

END Update_Action_History_No_Act;
Line: 2070

PROCEDURE UpdateActionHistory(p_document_id      NUMBER,
                              p_action           VARCHAR2,
                              p_note             VARCHAR2,
                              p_current_approver NUMBER) IS

pragma AUTONOMOUS_TRANSACTION;
Line: 2081

       UPDATE po_action_history
          SET action_code = p_action,
              note = p_note,
              action_date = sysdate
        WHERE object_id = p_document_id and
              employee_id = p_current_approver and
              action_code is null and
              object_type_code = 'REQUISITION'
              and rownum=1;
Line: 2093

       UPDATE po_action_history
          SET action_code = p_action,
              note = p_note,
              action_date = sysdate
        WHERE object_id = p_document_id and
              action_code is null and
              object_type_code = 'REQUISITION'
;
Line: 2110

END UpdateActionHistory;
Line: 2162

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_doc_string );
Line: 2207

        select first_position_id, first_approver_id
        into l_first_position_id, l_first_approver_id
        from po_requisition_headers_all
        where documentId = requisition_header_id;
Line: 2222

                  SELECT full_name
                  INTO l_next_approver_name
                  FROM per_all_people_f person
                  WHERE person_id = l_first_approver_id
                  --Bug#7207213#This query fetches multiple records so adding a filter
                  and trunc(sysdate) between person.effective_start_date and nvl(person.effective_end_date, trunc(sysdate));
Line: 2232

                        SELECT person_id, full_name into l_next_approver_id,l_next_approver_name FROM (
                               SELECT person.person_id, person.full_name FROM per_all_people_f person, per_all_assignments_f asg
                               WHERE asg.position_id = g_next_approvers(l_approver_index).orig_system_id and trunc(sysdate) between person.effective_start_date
                               and nvl(person.effective_end_date, trunc(sysdate)) and person.person_id = asg.person_id
                               and asg.primary_flag = 'Y' and asg.assignment_type in ('E','C')
                               and ( person.current_employee_flag = 'Y' or person.current_npw_flag = 'Y' )
                               and asg.assignment_status_type_id not in (
                                  SELECT assignment_status_type_id FROM per_assignment_status_types
                                  WHERE per_system_status = 'TERM_ASSIGN'
                               ) and trunc(sysdate) between asg.effective_start_date and asg.effective_end_date order by person.last_name
                        ) where rownum = 1;
Line: 2259

                     ame_api2.updateApprovalStatus( applicationIdIn    =>applicationId,
                                                    transactionIdIn    =>documentId,
                                                    transactionTypeIn  =>documentType,
                                                    approverIn         => g_next_approvers(l_approver_index)
                                                  );
Line: 2273

                     g_next_approvers.delete(l_approver_index);