DBA Data[Home] [Help]

APPS.MTH_PROCESS_STATUS_PKG dependencies on MTH_TAG_REASON_READINGS

Line 1484: INSERT INTO MTH_TAG_REASON_READINGS (REASON_TYPE,

1480: AND stg.DOWNTIME_REASON_CODE = lkp.LOOKUP_CODE (+) AND stg.err_code IS NULL );
1481: mth_util_pkg.log_msg('Number of rows inserted in MTH_EQUIP_STATUSES - ' || SQL%ROWCOUNT, mth_util_pkg.G_DBG_ROW_CNT);
1482:
1483: --Insertion of records in tag reason readings
1484: INSERT INTO MTH_TAG_REASON_READINGS (REASON_TYPE,
1485: EQUIPMENT_FK_KEY,
1486: FROM_DATE,
1487: To_Date,
1488: REASON_CODE,

Line 1549: mth_util_pkg.log_msg('Number of rows inserted in MTH_TAG_REASON_READINGS - ' || SQL%ROWCOUNT, mth_util_pkg.G_DBG_ROW_CNT);

1545: WHERE equipment_pk = stg.equipment_fk )
1546: AND stg.err_code IS NULL
1547: );
1548:
1549: mth_util_pkg.log_msg('Number of rows inserted in MTH_TAG_REASON_READINGS - ' || SQL%ROWCOUNT, mth_util_pkg.G_DBG_ROW_CNT);
1550:
1551: mth_util_pkg.truncate_table_partition('MTH_EQUIP_STATUSES_STG',v_processing_flag);
1552:
1553: mth_util_pkg.log_msg('INIT_STATUS_FROM_CSV end', mth_util_pkg.G_DBG_PROC_FUN_END);

Line 2274: MTH_TAG_REASON_READINGS trr

2270: mth_util_pkg.log_msg('Number of rows merged in MTH_EQUIP_STATUSES - ' || SQL%ROWCOUNT, mth_util_pkg.G_DBG_ROW_CNT);
2271:
2272: MERGE
2273: INTO
2274: MTH_TAG_REASON_READINGS trr
2275: USING
2276: (SELECT 1 reason_type,
2277: sts.equipment_fk_key equipment_fk_key,
2278: sts.from_date from_date,

Line 2356: mth_util_pkg.log_msg('Number of rows merged in MTH_TAG_REASON_READINGS - ' || SQL%ROWCOUNT, mth_util_pkg.G_DBG_ROW_CNT);

2352: subquery.oth_col,
2353: subquery.reading_time,
2354: subquery.hour_fk_key);
2355:
2356: mth_util_pkg.log_msg('Number of rows merged in MTH_TAG_REASON_READINGS - ' || SQL%ROWCOUNT, mth_util_pkg.G_DBG_ROW_CNT);
2357:
2358: mth_util_pkg.truncate_table_partition('MTH_EQUIP_STATUSES_STG',v_processing_flag);
2359:
2360: mth_util_pkg.log_msg('INCR_STATUS_FROM_CSV end', mth_util_pkg.G_DBG_PROC_FUN_END);

Line 2544: UPDATE mth_tag_reason_readings sts

2540: mth_util_pkg.log_msg('Number of rows updated for to_date MTH_EQUIP_STATUSES - ' || SQL%ROWCOUNT, mth_util_pkg.G_DBG_ROW_CNT);
2541: END IF;
2542:
2543: -- Update the tag reason readings before deleting records for recalculation
2544: UPDATE mth_tag_reason_readings sts
2545: SET sts.To_Date = (SELECT recal.new_to_date
2546: FROM (SELECT equipment_fk_key,from_date,To_Date,
2547: CASE WHEN (from_date < p_recal_from_date AND To_Date >= p_recal_from_date
2548: --AND p_recal_from_date < (To_Date - 1/86400)

Line 2552: FROM mth_tag_reason_readings)recal

2548: --AND p_recal_from_date < (To_Date - 1/86400)
2549: )
2550: THEN (p_recal_from_date - 1/86400)
2551: END new_To_Date
2552: FROM mth_tag_reason_readings)recal
2553: WHERE sts.equipment_fk_key = recal.equipment_fk_key
2554: AND sts.from_date = recal.FROM_date
2555: AND sts.To_Date = recal.To_Date
2556: AND sts.equipment_fk_key = Nvl(p_equipment_pk_key,sts.equipment_fk_key)

Line 2565: FROM mth_tag_reason_readings)rcl

2561: --AND p_recal_from_date < (To_Date - 1/86400)
2562: )
2563: THEN (p_recal_from_date - 1/86400)
2564: END new_To_Date
2565: FROM mth_tag_reason_readings)rcl
2566: WHERE sts.equipment_fk_key = rcl.equipment_fk_key
2567: AND sts.from_date = rcl.FROM_date
2568: AND sts.To_Date = rcl.To_Date
2569: AND sts.equipment_fk_key = Nvl(p_equipment_pk_key,sts.equipment_fk_key)

Line 2572: mth_util_pkg.log_msg('Number of rows updated for from_date MTH_TAG_REASON_READINGS - ' || SQL%ROWCOUNT, mth_util_pkg.G_DBG_ROW_CNT);

2568: AND sts.To_Date = rcl.To_Date
2569: AND sts.equipment_fk_key = Nvl(p_equipment_pk_key,sts.equipment_fk_key)
2570: AND rcl.new_to_date IS NOT NULL);
2571:
2572: mth_util_pkg.log_msg('Number of rows updated for from_date MTH_TAG_REASON_READINGS - ' || SQL%ROWCOUNT, mth_util_pkg.G_DBG_ROW_CNT);
2573:
2574: IF (p_recal_to_date IS NOT NULL) THEN
2575: UPDATE mth_tag_reason_readings sts
2576: SET sts.from_date = (SELECT recal.new_from_date

Line 2575: UPDATE mth_tag_reason_readings sts

2571:
2572: mth_util_pkg.log_msg('Number of rows updated for from_date MTH_TAG_REASON_READINGS - ' || SQL%ROWCOUNT, mth_util_pkg.G_DBG_ROW_CNT);
2573:
2574: IF (p_recal_to_date IS NOT NULL) THEN
2575: UPDATE mth_tag_reason_readings sts
2576: SET sts.from_date = (SELECT recal.new_from_date
2577: FROM (SELECT equipment_fk_key, from_date,To_Date,
2578: CASE WHEN (from_date <= p_recal_to_date AND To_Date > p_recal_to_date
2579: --AND p_recal_to_date < (To_Date + 1/86400)

Line 2583: FROM mth_tag_reason_readings)recal

2579: --AND p_recal_to_date < (To_Date + 1/86400)
2580: )
2581: THEN (p_recal_to_date + 1/86400)
2582: END new_from_date
2583: FROM mth_tag_reason_readings)recal
2584: WHERE sts.equipment_fk_key = recal.equipment_fk_key
2585: AND sts.from_date = recal.FROM_date
2586: AND sts.To_Date = recal.To_Date
2587: AND sts.equipment_fk_key = Nvl(p_equipment_pk_key,sts.equipment_fk_key)

Line 2596: FROM mth_tag_reason_readings)rcl

2592: --AND p_recal_to_date < (To_Date + 1/86400)
2593: )
2594: THEN (p_recal_to_date + 1/86400)
2595: END new_from_date
2596: FROM mth_tag_reason_readings)rcl
2597: WHERE sts.equipment_fk_key = rcl.equipment_fk_key
2598: AND sts.from_date = rcl.FROM_date
2599: AND sts.To_Date = rcl.To_Date
2600: AND sts.equipment_fk_key = Nvl(p_equipment_pk_key,sts.equipment_fk_key)

Line 2603: mth_util_pkg.log_msg('Number of rows updated for to_date MTH_TAG_REASON_READINGS - ' || SQL%ROWCOUNT, mth_util_pkg.G_DBG_ROW_CNT);

2599: AND sts.To_Date = rcl.To_Date
2600: AND sts.equipment_fk_key = Nvl(p_equipment_pk_key,sts.equipment_fk_key)
2601: AND rcl.new_from_date IS NOT NULL);
2602:
2603: mth_util_pkg.log_msg('Number of rows updated for to_date MTH_TAG_REASON_READINGS - ' || SQL%ROWCOUNT, mth_util_pkg.G_DBG_ROW_CNT);
2604: END IF;
2605:
2606: --Delete records from status table for the recalculation time range
2607: IF (p_equipment_pk_key IS NULL AND p_plant_pk_key IS NOT NULL) THEN

Line 2628: FROM mth_tag_reason_readings

2624:
2625: --Delete records from tag reason readings table for the recalculation time range
2626: IF (p_equipment_pk_key IS NULL AND p_plant_pk_key IS NOT NULL) THEN
2627: DELETE
2628: FROM mth_tag_reason_readings
2629: WHERE from_date >= p_recal_from_date
2630: AND nvl(To_Date,sysdate) <= nvl(p_recal_to_date,nvl(To_Date,sysdate))
2631: AND reason_type IN (1,3)
2632: AND equipment_fk_key IN ( SELECT equipment_pk_key

Line 2637: FROM mth_tag_reason_readings

2633: FROM mth_equipments_d
2634: WHERE plant_fk_key = p_plant_pk_key);
2635: ELSE
2636: DELETE
2637: FROM mth_tag_reason_readings
2638: WHERE from_date >= p_recal_from_date
2639: AND nvl(To_Date,sysdate) <= nvl(p_recal_to_date,nvl(To_Date,sysdate))
2640: AND reason_type IN (1,3)
2641: AND equipment_fk_key = NVL(p_equipment_pk_key,equipment_fk_key);

Line 2644: mth_util_pkg.log_msg('Number of rows deleted from MTH_TAG_REASON_READINGS - ' || SQL%ROWCOUNT, mth_util_pkg.G_DBG_ROW_CNT);

2640: AND reason_type IN (1,3)
2641: AND equipment_fk_key = NVL(p_equipment_pk_key,equipment_fk_key);
2642: END IF;
2643:
2644: mth_util_pkg.log_msg('Number of rows deleted from MTH_TAG_REASON_READINGS - ' || SQL%ROWCOUNT, mth_util_pkg.G_DBG_ROW_CNT);
2645:
2646: --Execute all validations on csv records
2647: -- Validation for Duplicate record
2648: UPDATE mth_equip_statuses_stg stg

Line 3221: INSERT INTO MTH_TAG_REASON_READINGS (REASON_TYPE,

3217: mth_util_pkg.log_msg('Number of rows inserted in MTH_EQUIP_STATUSES - ' || SQL%ROWCOUNT, mth_util_pkg.G_DBG_ROW_CNT);
3218: v_count := SQL%ROWCOUNT;
3219:
3220: --Insertion of records in tag reason readings
3221: INSERT INTO MTH_TAG_REASON_READINGS (REASON_TYPE,
3222: EQUIPMENT_FK_KEY,
3223: FROM_DATE,
3224: To_Date,
3225: REASON_CODE,

Line 3283: mth_util_pkg.log_msg('Number of rows inserted in MTH_TAG_REASON_READINGS - ' || SQL%ROWCOUNT, mth_util_pkg.G_DBG_ROW_CNT);

3279: FROM mth_equipments_d
3280: WHERE equipment_pk = stg.equipment_fk )
3281: AND stg.err_code IS NULL
3282: );
3283: mth_util_pkg.log_msg('Number of rows inserted in MTH_TAG_REASON_READINGS - ' || SQL%ROWCOUNT, mth_util_pkg.G_DBG_ROW_CNT);
3284:
3285: mth_util_pkg.log_msg('RECAL_STATUS_FROM_CSV end', mth_util_pkg.G_DBG_PROC_FUN_END);
3286: EXCEPTION
3287: WHEN SITE_MIS_ERR THEN