90: and dp.xla_conversion_status not like 'U%'
91: and exists
92: (
93: select 'x'
94: from gl_period_statuses ps,
95: fa_book_controls bc
96: where ps.application_id = 101
97: and ps.migration_status_code in ('P', 'U')
98: and bc.set_of_books_id = ps.set_of_books_id
351: l_return_status number;
352:
353: cursor c_periods is
354: select bc.book_type_code, ps.period_name
355: from gl_period_statuses ps,
356: fa_book_controls bc
357: where ps.application_id = 101
358: and ps.migration_status_code in ('P', 'U')
359: and bc.set_of_books_id = ps.set_of_books_id;
547: where dp.xla_conversion_status = to_char (p_workers_num)
548: and exists
549: (
550: select 'x'
551: from gl_period_statuses ps,
552: fa_book_controls bc
553: where ps.application_id = 101
554: and ps.migration_status_code in ('P', 'U')
555: and bc.set_of_books_id = ps.set_of_books_id
565: and dp.xla_conversion_status is not null
566: and exists
567: (
568: select 'x'
569: from gl_period_statuses ps,
570: fa_book_controls bc
571: where ps.application_id = 101
572: and ps.migration_status_code in ('P', 'U')
573: and bc.set_of_books_id = ps.set_of_books_id
611: l_return_status number;
612:
613: cursor c_periods is
614: select bc.book_type_code, ps.period_name
615: from gl_period_statuses ps,
616: fa_book_controls bc
617: where ps.application_id = 101
618: and ps.migration_status_code in ('P', 'U')
619: and bc.set_of_books_id = ps.set_of_books_id;
638: and dp.xla_conversion_status not in ('UA', 'UD')
639: and exists
640: (
641: select 'x'
642: from gl_period_statuses ps,
643: fa_book_controls bc
644: where ps.application_id = 101
645: and ps.migration_status_code in ('P', 'U')
646: and bc.set_of_books_id = ps.set_of_books_id
903: end if;
904: EXCEPTION WHEN OTHERS THEN raise;
905: END ;
906:
907: procedure sync_gl_period_statuses is
908: begin
909: -- Fix for Bug #5596250. Need to update migration_status_code to null
910: -- for any periods that do not exist.
911: -- we can run this step any number of times without impacting upgrade
912: -- for FA.
913: --
914: -- ledgers in gl not used by FA or periods not used by FA
915: -- need to be set to 'U' from 'P'
916: UPDATE gl_period_statuses ps
917: SET ps.migration_status_code = 'U'
918: WHERE ps.migration_status_code = 'P'
919: AND ps.application_id = 101
920: AND (ps.ledger_id, ps.period_name) not in
937: l_status_is_n boolean;
938:
939: CURSOR c_periods IS
940: SELECT period_name, ledger_id
941: FROM gl_period_statuses
942: WHERE migration_status_code = 'P'
943: AND application_id = 101
944: ORDER BY ledger_id, period_name
945: FOR UPDATE OF migration_status_code;
958: , o_status_is_n => l_status_is_n
959: );
960: IF (NOT l_status_is_u) AND (l_status_is_p) AND (NOT l_status_is_n) THEN
961:
962: UPDATE gl_period_statuses
963: SET migration_status_code = 'P'
964: WHERE CURRENT OF c_periods;
965:
966: ELSIF (l_status_is_u) AND (NOT l_status_is_p) AND (NOT l_status_is_n) THEN
964: WHERE CURRENT OF c_periods;
965:
966: ELSIF (l_status_is_u) AND (NOT l_status_is_p) AND (NOT l_status_is_n) THEN
967:
968: UPDATE gl_period_statuses
969: SET migration_status_code = 'U'
970: WHERE CURRENT OF c_periods;
971:
972: ELSIF (NOT l_status_is_u) AND (NOT l_status_is_p) AND ( l_status_is_n) THEN
970: WHERE CURRENT OF c_periods;
971:
972: ELSIF (NOT l_status_is_u) AND (NOT l_status_is_p) AND ( l_status_is_n) THEN
973:
974: UPDATE gl_period_statuses
975: SET migration_status_code = null /* this will be reset to P when hot patch is re-run */
976: WHERE CURRENT OF c_periods;
977:
978: END IF;
989: -- We sync gl period status info before and after the
990: -- main logic to ensure that we are on safe side....
991: -- We have hit bugs with XLA HOT Patch...
992:
993: sync_gl_period_statuses;
994: -- We need to find the total number of workers, but we need this script
995: -- to only run once, so exit if it is not the first worker.
996:
997: if (p_worker_id <> 1) then return; end if;
1003: where dp.xla_conversion_status = to_char (p_workers_num)
1004: and exists
1005: (
1006: select 'x'
1007: from gl_period_statuses ps,
1008: fa_book_controls bc
1009: where ps.application_id = 101
1010: and ps.migration_status_code in ('P', 'U')
1011: and bc.set_of_books_id = ps.set_of_books_id
1023: and dp.xla_conversion_status is not null
1024: and exists
1025: (
1026: select 'x'
1027: from gl_period_statuses ps,
1028: fa_book_controls bc
1029: where ps.application_id = 101
1030: and ps.migration_status_code in ('P', 'U')
1031: and bc.set_of_books_id = ps.set_of_books_id
1035:
1036: COMMIT;
1037:
1038:
1039: sync_gl_period_statuses; /* we need this again to sync deprn periods with gl period statuses */
1040:
1041: errbuf := 'Execution is successful';
1042: retcode := 0;
1043: EXCEPTION WHEN OTHERS THEN