DBA Data[Home] [Help]

APPS.GL_AUTOPOST_PKG SQL Statements

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

Line: 58

      SELECT chart_of_accounts_id,
             enable_budgetary_control_flag,
             enable_automatic_tax_flag,
             enable_je_approval_flag,
             GL_JE_POSTING_S.nextval
      FROM GL_LEDGERS
      WHERE ledger_id = p_ledger_id;
Line: 67

     SELECT max(JEH.ledger_id)
     FROM   GL_JE_BATCHES JEB,
            GL_JE_HEADERS JEH
     WHERE  JEB.status = 'S'
     AND    JEB.posting_run_id = p_posting_run_id
     AND    JEH.je_batch_id = JEB.je_batch_id
     GROUP BY JEB.posting_run_id
     HAVING count(distinct JEH.ledger_id) = 1;
Line: 77

     SELECT '1'
     FROM   GL_JE_BATCHES JEB,
            GL_JE_HEADERS JEH
     WHERE  JEB.status = 'S'
     AND    JEB.posting_run_id = p_posting_run_id
     AND    JEH.je_batch_id = JEB.je_batch_id
     AND    JEH.actual_flag <> 'B'
     AND    JEH.reversed_je_header_id IS NULL
     AND EXISTS
       (SELECT 1
        FROM   GL_LEDGER_RELATIONSHIPS LRL
        WHERE  LRL.source_ledger_id = JEH.ledger_id
        AND    LRL.target_ledger_category_code = 'ALC'
        AND    LRL.relationship_type_code IN ('JOURNAL', 'SUBLEDGER')
        AND    LRL.application_id = 101
        AND    LRL.relationship_enabled_flag = 'Y'
        AND    JEH.je_source NOT IN
          (SELECT INC.je_source_name
           FROM   GL_JE_INCLUSION_RULES INC
           WHERE  INC.je_rule_set_id =
                     LRL.gl_je_conversion_set_id
           AND    INC.je_source_name = JEH.je_source
           AND    INC.je_category_name = 'Other'
           AND    INC.include_flag = 'N'
           AND    INC.user_updatable_flag = 'N'));
Line: 134

    ok_to_update_batch                BOOLEAN;
Line: 193

SELECT b.je_batch_id,
    b.status,
    b.default_period_name,
    b.actual_flag,
    b.request_id
FROM gl_je_batches b
WHERE (b.status < ''P'' OR b.status > ''P'')
AND b.status_verified = ''N''
AND b.budgetary_control_status != ''I''
AND greatest(nvl(b.running_total_dr,0),nvl(b.running_total_cr,0)) =
      decode(b.control_total,null, greatest(nvl(b.running_total_dr,0),
        nvl(b.running_total_cr,0)), b.control_total) ';
Line: 240

  (SELECT h.je_batch_id
   FROM GL_LEDGERS ledger,
        GL_JE_HEADERS h,
        GL_BUDGETS glb,
        GL_BUDGET_VERSIONS bv,
        GL_PERIOD_STATUSES ps1,
        GL_PERIOD_STATUSES ps2
   WHERE ps2.ledger_id = '||v_ledger_id||'
     AND ps2.application_id = 101
     AND ps1.ledger_id (+) = '||v_ledger_id||'
     AND ps1.application_id (+) = 101
     AND ledger.ledger_id = '||v_ledger_id||'
     AND h.ledger_id = '||v_ledger_id||'
     AND h.period_name = ps2.period_name
     AND ps2.period_year <=
           decode(h.actual_flag,
                  ''E'', ledger.latest_encumbrance_year,
                  ''B'', glb.latest_opened_year,
                  ''A'', decode (ps2.closing_status,''O'',ps2.period_year, -1))
     AND ps2.period_year >=
           decode(h.actual_flag,
                  ''B'', ps1.period_year,
                  ps2.period_year)
     AND b.je_batch_id = h.je_batch_id
     AND h.budget_version_id = bv.budget_version_id (+)
     AND bv.budget_name = glb.budget_name (+)
     AND glb.status (+) != ''F''
     AND ps1.period_name (+) = glb.first_valid_period_name ';
Line: 301

AND NOT EXISTS (SELECT 1
                FROM GL_JE_HEADERS h
                WHERE h.je_batch_id = b.je_batch_id
                  AND (';
Line: 339

AND NOT EXISTS (SELECT 1
                FROM GL_JE_HEADERS glh
                WHERE glh.tax_status_code = ''R''
                  AND glh.je_batch_id = b.je_batch_id
                  AND b.actual_flag = ''A''
                  AND glh.currency_code != ''STAT''
                  AND glh.je_source = ''Manual'')';
Line: 351

FOR UPDATE OF status, posting_run_id NOWAIT ';
Line: 355

      Debug_Print_Msg('SQL Statement to select batches:');
Line: 382

            ok_to_update_batch := FALSE;
Line: 395

              ok_to_update_batch := FALSE;
Line: 399

              ok_to_update_batch := TRUE;
Line: 403

              ok_to_update_batch := TRUE;
Line: 406

              ok_to_update_batch := FALSE;
Line: 411

            ok_to_update_batch := TRUE;
Line: 415

        IF (ok_to_update_batch) THEN
          UPDATE gl_je_batches
          SET status = 'S',
              posting_run_id = v_posting_run_id
          WHERE je_batch_id = v_je_batch_id;
Line: 426

          IF (ok_to_update_batch) THEN
            Debug_Print_Msg('Batch with ID '||v_je_batch_id||' selected for posting');
Line: 438

      Debug_Print_Msg('The number of batch selected for posting is :'||v_count_sel_bat);
Line: 503

      UPDATE GL_CONSOLIDATION_HISTORY
      SET   status = 'PS',
            request_id = v_request_id
      WHERE je_batch_id IN (SELECT je_batch_id
                            FROM gl_je_batches
                            WHERE posting_run_id = v_posting_run_id
                            AND status = 'S');
Line: 511

      UPDATE GL_ELIMINATION_HISTORY EH
      SET EH.status_code = 'PS',
          EH.request_id = v_request_id
      WHERE EH.je_batch_id IN (SELECT je_batch_id
                               FROM gl_je_batches
                               WHERE posting_run_id = v_posting_run_id
                               AND status = 'S');