DBA Data[Home] [Help]

APPS.POA_SAVINGS_MAIN SQL Statements

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

Line: 39

        SELECT PO_DISTRIBUTION_ID, 1,ceil(rownum/p_batch_size)
         FROM (SELECT  pod.PO_DISTRIBUTION_ID,pol.item_id,pod.creation_date
        FROM    po_lines_all                    pol,
                po_line_locations_all           pll,
                po_headers_all                  poh,
                po_distributions_all            pod
        WHERE   pod.line_location_id            = pll.line_location_id
        and     pod.po_line_id                  = pol.po_line_id
        and     pod.po_header_id                = poh.po_header_id
        and     pll.shipment_type               = 'STANDARD'
        and     pll.approved_flag               = 'Y'
        and     nvl(pod.distribution_type,'-99') <> 'AGREEMENT'
        and     greatest(pol.last_update_date, pll.last_update_date,
                         poh.last_update_date, pod.last_update_date, nvl(pod.program_update_date, pod.last_update_date))
                between  p_start_date and p_end_date
        UNION ALL
        SELECT  pod.PO_DISTRIBUTION_ID,pol.item_id,pod.creation_date
        FROM    po_lines_all                    pol,
                po_line_locations_all           pll,
                po_headers_all                  poh,
                po_releases_all                 por,
                po_distributions_all            pod
        WHERE   pod.line_location_id            = pll.line_location_id
        and     pod.po_release_id               = por.po_release_id
        and     pod.po_line_id                  = pol.po_line_id
        and     pod.po_header_id                = poh.po_header_id
        and     pll.shipment_type               in ('BLANKET', 'SCHEDULED')
        and     pll.approved_flag               = 'Y'
        and     nvl(pod.distribution_type,'-99') <> 'AGREEMENT'
        and     greatest(pol.last_update_date,pll.last_update_date,
                   poh.last_update_date,por.last_update_date,pod.last_update_date, nvl(pod.program_update_date, pod.last_update_date))
                between  p_start_date and p_end_date)
       order by item_id,creation_date;
Line: 81

    select sysdate into l_start_time from dual;
Line: 97

        /* l_primary_key.delete; l_seq_id.delete; l_batch_id.delete; */
Line: 102

	    INSERT INTO poa_edw_po_dist_inc (primary_key, seq_id,batch_id) values(l_primary_key(i),l_seq_id(i),l_batch_id(i));
Line: 106

        select sysdate into l_end_time from dual;
Line: 117

    delete from poa_bis_savings_rpt
    where  last_update_date <= sysdate - 2;
Line: 126

    select max(batch_id) into l_no_batch from poa_edw_po_dist_inc;
Line: 128

    SELECT sysdate INTO v_start_time from sys.dual;
Line: 140

    select sysdate into l_end_time from dual;
Line: 156

    SELECT distinct pod.code_combination_id
    ,      pod.set_of_books_id
    FROM   po_distributions_all pod
    where  pod.po_distribution_id IN
      (SELECT distinct poa.distribution_transaction_id
      FROM poa_bis_savings poa);
Line: 176

      UPDATE poa_bis_savings poa
      set cost_center_id = v_cost_center_id,
          account_id     = v_account_id,
          company_id     = v_company_id
      WHERE poa.distribution_transaction_id IN
        (SELECT pod.po_distribution_id
        FROM po_distributions_all pod
        WHERE pod.code_combination_id = v_ccid
        and   pod.set_of_books_id = v_set_of_books_id);