DBA Data[Home] [Help]

APPS.PA_AP_XFER_PKG SQL Statements

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

Line: 27

/*Cursor to select the invoices for the newly created cdls after recalc*/
CURSOR Inv_stat_cur
 IS
   Select distinct system_reference2
   from pa_cost_distribution_lines cdl,
        pa_expenditure_items ei
   where ei.cost_distributed_flag ='S'
     AND ei.request_id = g_request_id
     AND ei.system_linkage_function = 'VI'
     AND cdl.transfer_status_code = 'P'
     AND cdl.line_type ='R'
     AND cdl.request_id = g_request_id
     AND cdl.expenditure_item_id = ei.expenditure_item_id;
Line: 41

/*Cursor to select all the reversal cdls (line_type 'R') for the expenditure_item_ids
  marked with cost_distributed_flag as 'S'  */

CURSOR rev_cdl_cur
  IS
  SELECT cdl.expenditure_item_id
        ,cdl.line_num
        ,cdl.line_num_reversed
        ,cdl.dr_code_combination_id
   FROM  pa_expenditure_items_all ei
        ,pa_cost_distribution_lines_all cdl
   WHERE ei.cost_distributed_flag = 'S'
     AND ei.request_id = g_request_id
     AND ei.system_linkage_function = 'VI'
     AND cdl.transfer_status_code = 'P'
     AND cdl.request_id = g_request_id
     AND cdl.line_type = 'R'
     AND cdl.expenditure_item_id = ei.expenditure_item_id
     AND cdl.line_num_reversed is NOT NULL
  ORDER BY cdl.expenditure_item_id
          ,cdl.line_num;
Line: 96

   UPDATE PA_COST_DISTRIBUTION_LINES
    SET transfer_status_code ='B'
   WHERE system_reference2 =l_system_reference2
   AND   transfer_status_code = 'P'
   AND   line_type ='R'
   AND   request_id = g_request_id ;
Line: 159

        UPDATE PA_COST_DISTRIBUTION_LINES_ALL a
         SET a.TRANSFER_STATUS_CODE ='B'
        WHERE a.expenditure_item_id = l_expenditure_item_id_tab(i)
        AND   a.line_num in (l_line_num_tab(i) ,l_line_num_tab(i)+ 1)
        AND   EXISTS (SELECT 1
                      FROM PA_COST_DISTRIBUTION_LINES_ALL cdl
                      WHERE cdl.expenditure_item_id = a.expenditure_item_id
                      AND   cdl.line_num = l_line_num_tab(i) +1
                      AND   cdl.dr_code_combination_id =l_dr_code_combination_id_tab(i));