[Home] [Help]
419: p_cal_period_year => p_cal_period_year,
420: errbuf => errbuf,
421: retcode => retcode);
422:
423: INSERT INTO FEM_BALANCES(
424: DATASET_CODE,
425: CAL_PERIOD_ID,
426: CREATION_ROW_SEQUENCE,
427: SOURCE_SYSTEM_CODE,
532: errbuf => errbuf,
533: retcode => retcode);
534:
535: IF (p_mode = 'M') THEN
536: MERGE INTO FEM_BALANCES FB
537: USING(
538: SELECT
539: p_hier_dataset_code DATASET_CODE,
540: p_cal_period_id CAL_PERIOD_ID,
616: GFB.YTD_DEBIT_BALANCE_E,
617: GFB.YTD_CREDIT_BALANCE_E);
618:
619: ELSE
620: MERGE INTO FEM_BALANCES FB
621: USING(
622: SELECT
623: p_hier_dataset_code DATASET_CODE,
624: p_cal_period_id CAL_PERIOD_ID,
736: IF (SQL%ROWCOUNT <> 0) THEN
737: FEM_DIMENSION_UTIL_PKG.Register_Data_Location
738: (P_REQUEST_ID => l_req_id,
739: P_OBJECT_ID => p_object_id,
740: P_TABLE_NAME => 'FEM_BALANCES',
741: P_LEDGER_ID => p_ledger_id,
742: P_CAL_PER_ID => p_cal_period_id,
743: P_DATASET_CD => p_hier_dataset_code,
744: P_SOURCE_CD => g_src_sys_code,
848: END IF;
849:
850: BEGIN
851:
852: -- Delete data from FEM_BALANCES for UNDO mode
853: -- Bugfix 5704055: This mode will only be called when removing Data Prep and Aggregation Rows
854: IF p_undo = 'Y' AND p_entry_id IS NULL THEN
855: SELECT child_entity_id
856: INTO l_entity_id
856: INTO l_entity_id
857: FROM gcs_cons_eng_run_dtls
858: WHERE run_detail_id = p_run_detail_id;
859:
860: DELETE /*+ INDEX(FEM_BALANCES FEM_BALANCES_N4) */ FROM FEM_BALANCES
861: WHERE dataset_code = p_hier_dataset_code
862: AND cal_period_id = p_cal_period_id
863: AND ledger_id = l_ledger_id
864: AND created_by_object_id = l_object_id
875: INTO l_entity_id
876: FROM gcs_entry_headers
877: WHERE entry_id = p_entry_id;
878:
879: DELETE /*+ INDEX(FEM_BALANCES FEM_BALANCES_N4) */ FROM FEM_BALANCES
880: WHERE dataset_code = p_hier_dataset_code
881: AND cal_period_id = p_cal_period_id
882: AND ledger_id = l_ledger_id
883: AND created_by_object_id = l_object_id
1046: WHEN no_data_found THEN
1047: RETURN;
1048: END;
1049:
1050: -- Delete data from FEM_BALANCES for both the operating and elim entity
1051: --Bugfix 5704055: Added hints for the deletion
1052: FORALL i in l_objects_id.FIRST..l_objects_id.LAST
1053: DELETE /*+ INDEX(FEM_BALANCES FEM_BALANCES_N4) */ FROM FEM_BALANCES
1054: WHERE dataset_code = p_hier_dataset_code
1049:
1050: -- Delete data from FEM_BALANCES for both the operating and elim entity
1051: --Bugfix 5704055: Added hints for the deletion
1052: FORALL i in l_objects_id.FIRST..l_objects_id.LAST
1053: DELETE /*+ INDEX(FEM_BALANCES FEM_BALANCES_N4) */ FROM FEM_BALANCES
1054: WHERE dataset_code = p_hier_dataset_code
1055: AND cal_period_id = p_cal_period_id
1056: AND source_system_code = g_src_sys_code
1057: AND ledger_id = l_ledger_id
1069: WHEN no_data_found THEN
1070: RETURN;
1071: END;
1072:
1073: -- Delete data from FEM_BALANCES for the operating entity
1074: --Bugfix 5704055: Added hints for the deletion
1075: FORALL i in l_objects_id.FIRST..l_objects_id.LAST
1076: DELETE /*+ INDEX(FEM_BALANCES FEM_BALANCES_N4) */ FROM FEM_BALANCES
1077: WHERE dataset_code = p_hier_dataset_code
1072:
1073: -- Delete data from FEM_BALANCES for the operating entity
1074: --Bugfix 5704055: Added hints for the deletion
1075: FORALL i in l_objects_id.FIRST..l_objects_id.LAST
1076: DELETE /*+ INDEX(FEM_BALANCES FEM_BALANCES_N4) */ FROM FEM_BALANCES
1077: WHERE dataset_code = p_hier_dataset_code
1078: AND cal_period_id = p_cal_period_id
1079: AND source_system_code = g_src_sys_code
1080: AND ledger_id = l_ledger_id