DBA Data[Home] [Help]

APPS.AP_APXTRSWP_XMLP_PKG SQL Statements

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

Line: 20

  SELECT nvl(sob.sla_ledger_cash_basis_flag, 'N')
  INTO   cash_acct_flag
  FROM   gl_sets_of_books     sob
  WHERE  sob.set_of_books_id = p_set_of_books_id;
Line: 82

   SELECT  ly.meaning,
           ln.meaning,
           l1.displayed_field,
           l2.displayed_field,
           l3.displayed_field
   INTO    nls_yes,
	   nls_no,
	   nls_all,
	   nls_void,
	   nls_na
   FROM    fnd_lookups ly,
	   fnd_lookups ln,
	   ap_lookup_codes l1,
	   ap_lookup_codes l2,
	   ap_lookup_codes l3
   WHERE   ly.lookup_type = 'YES_NO'
     AND   ly.lookup_code = 'Y'
     AND   ln.lookup_type = 'YES_NO'
     AND   ln.lookup_code = 'N'
     AND   l1.lookup_type = 'NLS REPORT PARAMETER'
     AND   l1.lookup_code = 'ALL'
     AND   l2.lookup_type = 'NLS TRANSLATION'
     AND   l2.lookup_code = 'VOID'
     AND   l3.lookup_type = 'NLS REPORT PARAMETER'
     AND   l3.lookup_code = 'NA';
Line: 210

     THEN SELECT start_date, end_date
            INTO p_start_date, p_end_date
            FROM gl_period_statuses
           WHERE period_name = p_period_name
             AND application_id = 201
             AND set_of_books_id = p_set_of_books_id;
Line: 304

     if (update_acctg_dates() <> TRUE) then
        RAISE init_failure;
Line: 327

     SELECT  name,
             chart_of_accounts_id
     INTO    l_name,
             l_chart_of_accounts_id
     FROM    gl_sets_of_books
     WHERE   set_of_books_id = l_sob_id;
Line: 352

    SELECT COUNT(*)
      INTO cup_counter
      FROM ap_invoice_payments_all
     WHERE accounting_date BETWEEN p_start_date AND p_end_date
       AND posted_flag IN ('N','S') --Bug3476167
       AND org_id = co_org_id
       AND rownum = 1;
Line: 371

   SELECT COUNT(*)
     INTO cui_counter
     FROM ap_invoice_distributions_all
    WHERE accounting_date BETWEEN p_start_date AND p_end_date
      AND accrual_posted_flag = 'N'
      AND p_acct_method = 'A'
      AND org_id = CO_org_id
      AND rownum = 1;
Line: 391

   SELECT COUNT(*)
     INTO cfp_counter
     FROM ap_checks_all
    WHERE future_pay_due_date IS NOT NULL
      AND status_lookup_code = 'ISSUED'
      AND future_pay_due_date BETWEEN p_start_date AND p_end_date
      AND org_id = co_org_id
      AND rownum = 1;
Line: 411

   SELECT COUNT(*)
     INTO cpb_counter
     FROM ap_inv_selection_criteria_all
    WHERE check_date BETWEEN p_start_date AND p_end_date
      AND status NOT IN ('CONFIRMED', 'CANCELED', 'QUICKCHECK')
      AND org_id = co_org_id
      AND rownum = 1;
Line: 430

   SELECT COUNT(*)
     INTO cut_counter
     FROM xla_ae_headers xah, xla_transaction_entities xte
    WHERE xah.accounting_date BETWEEN p_start_date AND p_end_date
      AND xah.gl_transfer_status_code = 'N'
      AND xah.entity_id = xte.entity_id
      AND xte.security_id_int_1 = co_org_id
      AND rownum = 1;
Line: 467

    SELECT   multi_org_flag
  INTO  multi_org_installation
  FROM  fnd_product_groups
  WHERE product_group_id = 1;
Line: 518

    c_select_le := 'le.name ';
Line: 519

    c_select_ou := 'ou.name ';
Line: 529

   c_select_le := '''Legal Entity''';
Line: 530

   c_select_ou := '''Operating Unit''';
Line: 541

FUNCTION UPDATE_PO_CLOSE_DATE RETURN BOOLEAN IS



  CURSOR PO_LIST IS
   SELECT DISTINCT PLL.LINE_LOCATION_ID,
          PLL.CLOSED_DATE
   FROM   PO_LINE_LOCATIONS_ALL PLL,
          PO_DISTRIBUTIONS_ALL PD,
          AP_INVOICE_DISTRIBUTIONS_ALL AID
   WHERE PLL.LINE_LOCATION_ID = PD.LINE_LOCATION_ID
   AND PLL.CLOSED_DATE IS NOT NULL
   AND PD.PO_DISTRIBUTION_ID = AID.PO_DISTRIBUTION_ID
   AND AID.POSTED_FLAG = 'N'
   AND NVL(AID.ORG_ID,-99) = NVL(PD.ORG_ID,-99)
   AND NVL(AID.ORG_ID,-99) IN
           (SELECT NVL(ASP.ORG_ID,-99)
            FROM HR_ORGANIZATION_INFORMATION OI,
            HR_ALL_ORGANIZATION_UNITS_TL LE,
            HR_ALL_ORGANIZATION_UNITS_TL OU,
            AP_SYSTEM_PARAMETERS_ALL ASP,
            GL_SETS_OF_BOOKS SOB
            WHERE nvl(SOB.SLA_LEDGER_CASH_BASIS_FLAG, 'N') <> 'Y'
              AND SOB.SET_OF_BOOKS_ID = ASP.SET_OF_BOOKS_ID
              AND ASP.ORG_ID = OI.ORGANIZATION_ID
              AND OU.ORGANIZATION_ID = OI.ORGANIZATION_ID
              AND OI.ORG_INFORMATION_CONTEXT = 'Operating Unit Information'
              AND DECODE(LTRIM(OI.ORG_INFORMATION3,'0123456789'), NULL ,
                         TO_NUMBER(OI.ORG_INFORMATION3), NULL ) = P_SET_OF_BOOKS_ID
              AND DECODE(LTRIM(OI.ORG_INFORMATION2,'0123456789'), NULL ,
                         TO_NUMBER(OI.ORG_INFORMATION2), NULL )
                                                     = LE.ORGANIZATION_ID
              AND OU.ORGANIZATION_ID = OI.ORGANIZATION_ID
              AND OU.LANGUAGE = USERENV('LANG')
              AND LE.LANGUAGE = USERENV('LANG')
             )
   AND (   (P_PERIOD_NAME IS NULL AND AID.ACCOUNTING_DATE BETWEEN
                                           P_FROM_ACCTG_DATE and P_TO_ACCTG_DATE)
       OR  (P_PERIOD_NAME IS NOT NULL AND AID.PERIOD_NAME = P_PERIOD_NAME ))
   AND AID.PO_DISTRIBUTION_ID IS NOT NULL
   GROUP BY PLL.LINE_LOCATION_ID, PLL.CLOSED_DATE, AID.PO_DISTRIBUTION_ID
   HAVING SUM(AID.AMOUNT) > 0;
Line: 603

      update po_line_locations_all
      set    closed_date = c_sweep_to_date
      where  line_location_id = l_line_loc_id;
Line: 607

      select distinct POH.po_header_id,
             POH.closed_date
      into   l_header_id,
             l_header_close_date
      from   po_headers_all POH,
             po_line_locations_all PLL
      where  POH.po_header_id = PLL.po_header_id
      and    PLL.line_location_id = l_line_loc_id;
Line: 618

        update po_headers
        set    closed_date = c_sweep_to_date
        where  po_header_id = l_header_id;
Line: 634

FUNCTION UPDATE_ACCTG_DATES RETURN BOOLEAN IS

  CURSOR DIST_ORGS IS
  	SELECT aid.invoice_id, aid.invoice_distribution_id
	FROM ap_invoice_distributions_all aid
	WHERE aid.accrual_posted_flag = 'N'
    	AND ((p_period_name is null and aid.accounting_date between p_from_acctg_date
                                                        and p_to_acctg_date)
        OR (p_period_name is not null and aid.period_name = p_period_name))
    	AND nvl(aid.org_id, -99) IN
             (select nvl(asp.org_id, -99)
               from hr_organization_information oi,
                    hr_all_organization_units_tl le,
                    hr_all_organization_units_tl ou,
                    ap_system_parameters_all asp
              where asp.accounting_method_option = 'Accrual'
               and  asp.org_id = oi.organization_id
               and  ou.organization_id = oi.organization_id
               and  oi.org_information_context =
                   'Operating Unit Information'
               and  DECODE(LTRIM(oi.org_information3,'0123456789'), NULL
                         , TO_NUMBER(oi.org_information3) , NULL ) =
                    p_set_of_books_id
               and  DECODE(LTRIM(oi.org_information2,'0123456789'), NULL
                        , TO_NUMBER(oi.org_information2), NULL) =
                    le.organization_id
               and  ou.organization_id = oi.organization_id
               and  ou.language = USERENV('LANG')
               and  le.language = USERENV('LANG'));
Line: 665

	SELECT aid.invoice_id, aid.invoice_distribution_id
	FROM ap_invoice_distributions_all aid,
             ap_system_parameters_all asp
	WHERE aid.accrual_posted_flag = 'N'
	AND asp.accounting_method_option = 'Accrual'
    	AND ((p_period_name is null and aid.accounting_date between p_from_acctg_date
                                                        and p_to_acctg_date)
        OR (p_period_name is not null and aid.period_name = p_period_name));
Line: 680

/*SRW.MESSAGE(0, 'UPDATE_ACCTG_DATES');*/null;
Line: 682

 if (update_po_close_date() <> TRUE) then
    return(FALSE);
Line: 687

  select count(*)
  into v_no_orgs
  from ap_system_parameters_all;
Line: 708

	UPDATE ap_invoice_distributions_all aid
    	SET accounting_date = c_sweep_to_date,
        period_name = p_to_period,
        last_update_date = sysdate,
        last_updated_by = 5
  	WHERE aid.invoice_distribution_id = l_invoice_distribution_id;
Line: 730

  UPDATE ap_invoice_payments_all aip
    SET accounting_date = c_sweep_to_date,
        period_name = p_to_period,
        last_update_date = sysdate,
        last_updated_by = 5
  WHERE posted_flag IN ('N','S')     AND ((p_period_name is null and accounting_date between p_from_acctg_date
                                                    and p_to_acctg_date)
        OR (p_period_name is not null and period_name = p_period_name))
    AND nvl(aip.org_id, -99) IN
         (select nvl(asp.org_id, -99)
            from hr_organization_information oi,
                 hr_all_organization_units_tl le,
                 hr_all_organization_units_tl ou,
                 ap_system_parameters_all asp

          where
                            asp.org_id = oi.organization_id
            and ou.organization_id = oi.organization_id
            and oi.org_information_context =
                   'Operating Unit Information'
            and DECODE(LTRIM(oi.org_information3,'0123456789'), NULL
                         , TO_NUMBER(oi.org_information3) , NULL ) =
                   p_set_of_books_id
            and DECODE(LTRIM(oi.org_information2,'0123456789'), NULL
                        , TO_NUMBER(oi.org_information2), NULL) =
                   le.organization_id
            and ou.organization_id = oi.organization_id
            and ou.language = USERENV('LANG')
            and le.language = USERENV('LANG'));
Line: 765

  UPDATE ap_payment_history_all aph
    SET accounting_date = c_sweep_to_date,
        last_update_date = sysdate,
        last_updated_by = 5
  WHERE nvl(aph.posted_flag, 'N') IN ('N','S')


    AND ((p_period_name is null and accounting_date between p_from_acctg_date
                                                    and p_to_acctg_date)
        OR
         (p_period_name is not null and accounting_date between c_from_acctg_date
                                                       and c_to_acctg_date))
    AND nvl(aph.org_id, -99) IN
          (select nvl(asp.org_id, -99)
             from hr_organization_information oi,
                  hr_all_organization_units_tl le,
                  hr_all_organization_units_tl ou,
                  ap_system_parameters_all asp
            where
                                                                      asp.org_id = oi.organization_id
             and  ou.organization_id = oi.organization_id
             and  oi.org_information_context =
                    'Operating Unit Information'
             and  DECODE(LTRIM(oi.org_information3,'0123456789'), NULL
                          , TO_NUMBER(oi.org_information3) , NULL ) =
                    p_set_of_books_id
             and  DECODE(LTRIM(oi.org_information2,'0123456789'), NULL
                         , TO_NUMBER(oi.org_information2), NULL) =
                    le.organization_id
             and  ou.organization_id = oi.organization_id
             and  ou.language = USERENV('LANG')
             and  le.language = USERENV('LANG'));
Line: 809

      p_calling_sequence => 'APXTRSWP.rdf (update_acctg_dates() )'
    );
Line: 829

	UPDATE ap_invoice_distributions_all aid
    	SET accounting_date = c_sweep_to_date,
        period_name = p_to_period,
        last_update_date = sysdate,
        last_updated_by = 5
  	WHERE aid.invoice_distribution_id = l_invoice_distribution_id;
Line: 851

  UPDATE ap_invoice_payments_all aip
    SET accounting_date = c_sweep_to_date,
        period_name = p_to_period,
        last_update_date = sysdate,
        last_updated_by = 5
  WHERE posted_flag IN ('N','S')     AND ((p_period_name is null and accounting_date between p_from_acctg_date
                                                    and p_to_acctg_date)
        OR (p_period_name is not null and period_name = p_period_name));
Line: 865

  UPDATE ap_payment_history_all aph
    SET accounting_date = c_sweep_to_date,
        last_update_date = sysdate,
        last_updated_by = 5
  WHERE nvl(aph.posted_flag, 'N') IN ('N','S')     AND ((p_period_name is null and accounting_date between p_from_acctg_date
                                                    and p_to_acctg_date)
        OR
         (p_period_name is not null and accounting_date between c_from_acctg_date
                                                       and c_to_acctg_date));
Line: 882

      p_calling_sequence => 'APXTRSWP.rdf (update_acctg_dates() )'
    );
Line: 908

      SELECT start_date
        INTO l_to_acctg_date
        FROM gl_period_statuses
      WHERE period_name = p_to_period
        AND application_id = 200
        AND set_of_books_id = p_set_of_books_id
        AND nvl(adjustment_period_flag, 'N') = 'N';
Line: 926

      SELECT start_date,
             end_date
        INTO l_start_date,
             l_end_date
        FROM gl_period_statuses
      WHERE period_name = p_period_name
        AND application_id = 200
        AND set_of_books_id = p_set_of_books_id
        AND nvl(adjustment_period_flag, 'N') = 'N';
Line: 965

  SELECT nvl(sla_ledger_cash_basis_flag, 'N')
  INTO l_cash_basis_flag
  FROM gl_sets_of_books
  WHERE set_of_books_id = p_set_of_books_id;
Line: 1057

      ELSE SELECT COUNT(*)
             INTO cui_counter
             FROM ap_invoice_distributions_all
            WHERE accounting_date BETWEEN p_start_date AND p_end_date
              AND accrual_posted_flag = 'N'
              AND p_acct_method = 'A'
              AND org_id = CO_org_id
              AND rownum = 1;
Line: 1066

           SELECT COUNT(*)
             INTO cup_counter
             FROM ap_invoice_payments_all
            WHERE accounting_date BETWEEN p_start_date AND p_end_date
              AND posted_flag IN ('N','S')               AND org_id = co_org_id
              AND rownum = 1;
Line: 1073

                      SELECT COUNT(*)
             INTO cut_counter
             FROM xla_ae_headers xah, xla_transaction_entities xte
            WHERE xah.accounting_date BETWEEN p_start_date AND p_end_date
              AND xah.gl_transfer_status_code = 'N'
              AND xah.entity_id = xte.entity_id
              AND xte.security_id_int_1 = co_org_id
              AND rownum = 1;
Line: 1082

           SELECT COUNT(*)
             INTO cfp_counter
             FROM ap_checks_all
            WHERE future_pay_due_date IS NOT NULL
              AND status_lookup_code = 'ISSUED'
              AND future_pay_due_date BETWEEN p_start_date AND p_end_date
              AND org_id = co_org_id
              AND rownum = 1;
Line: 1091

           SELECT COUNT(*)
             INTO cpb_counter
             FROM ap_inv_selection_criteria_all
            WHERE check_date BETWEEN p_start_date AND p_end_date
              AND status NOT IN ('CONFIRMED', 'CANCELED', 'QUICKCHECK')
              AND org_id = co_org_id
              AND rownum = 1;
Line: 1191

 Function C_SELECT_LE_p return varchar2 is
	Begin
	 return C_SELECT_LE;
Line: 1195

 Function C_SELECT_OU_p return varchar2 is
	Begin
	 return C_SELECT_OU;
Line: 1252

      SELECT COUNT(*)
             INTO cui_counter
             FROM ap_invoice_distributions_all
            WHERE accounting_date     BETWEEN p_start_date AND p_end_date
              AND accrual_posted_flag = 'N'
              AND p_acct_method      = 'A'
              AND set_of_books_id     = p_set_of_books_id
              AND rownum              = 1;
Line: 1261

           SELECT COUNT(*)
             INTO cup_counter
             FROM ap_invoice_payments_all
            WHERE accounting_date BETWEEN p_start_date AND p_end_date
              AND posted_flag     IN ('N','S') --Bug 3476167
              AND set_of_books_id = p_set_of_books_id
              AND rownum          = 1;
Line: 1269

           SELECT COUNT(*)
             INTO cut_counter
             FROM xla_ae_headers --Bug 3739324
            WHERE accounting_date  BETWEEN p_start_date AND p_end_date
              AND gl_transfer_status_code = 'N'
              AND ledger_id  = p_set_of_books_id
              AND rownum           = 1;
Line: 1277

           SELECT COUNT(*)
             INTO cfp_counter
             FROM ap_checks_all AC, hr_operating_units HOU
            WHERE AC.org_id              = HOU.organization_id
              AND AC.future_pay_due_date IS NOT NULL
              AND AC.status_lookup_code  = 'ISSUED'
              AND AC.future_pay_due_date BETWEEN p_start_date AND p_end_date
              AND HOU.set_of_books_id    = to_char(p_set_of_books_id)  --Bug 2986690
              AND rownum                 = 1;
Line: 1287

           SELECT COUNT(*)
             INTO cpb_counter
             FROM ap_inv_selection_criteria_all AIS, hr_operating_units HOU
            WHERE AIS.org_id          = HOU.organization_id
              AND AIS.check_date      BETWEEN p_start_date AND p_end_date
              AND status              NOT IN ('CONFIRMED', 'CANCELED', 'QUICKCHECK')
              AND HOU.set_of_books_id = to_char(p_set_of_books_id)     --Bug 2986690
              AND rownum              = 1;