48: --IF there are no rows in facts 1 and facts 2 ending
49: --balances table, then error and return
50: SELECT count(*)
51: INTO l_facts1_eb_count
52: FROM fv_facts_ending_balances
53: WHERE fiscal_year = g_fiscal_year - 1;
54:
55: SELECT count(*)
56: INTO l_facts2_eb_count
457: WHERE fiscal_year = g_fiscal_year
458: AND fed_non_fed_flag = 'Y'
459: AND EXISTS
460: (SELECT 1
461: FROM fv_facts_ending_balances ff1e
462: WHERE ff1e.set_of_books_id = fgfa.set_of_books_id
463: AND ff1e.account_number = fgfa.account_number
464: AND ff1e.fiscal_year = g_fiscal_year - 1)
465: ORDER BY set_of_books_id;
473: d_c_indicator,
474: g_ng_indicator,
475: amount,
476: eliminations_dept
477: FROM fv_facts_ending_balances
478: WHERE set_of_books_id = v_sob_id
479: AND account_number = v_acct_number
480: AND fiscal_year = g_fiscal_year - 1;
481:
641: AND ff2e.account = fgfa.account_number
642: AND ff2e.fiscal_year = g_fiscal_year - 1)
643: MINUS
644: (SELECT account_number
645: FROM fv_facts_ending_balances ff1e
646: WHERE ff1e.set_of_books_id = fgfa.set_of_books_id
647: AND ff1e.account_number = fgfa.account_number
648: AND ff1e.fiscal_year = g_fiscal_year - 1));
649:
883: WHERE ff2e.set_of_books_id = fgfa.set_of_books_id
884: AND ff2e.account = fgfa.account_number
885: AND ff2e.fiscal_year = g_fiscal_year - 1) UNION ALL
886: (SELECT account_number
887: FROM fv_facts_ending_balances ff1e
888: WHERE ff1e.set_of_books_id = fgfa.set_of_books_id
889: AND ff1e.account_number = fgfa.account_number
890: AND ff1e.fiscal_year = g_fiscal_year - 1));
891: