DBA Data[Home] [Help]

APPS.MTH_SUSTAIN_ASPECT_PKG dependencies on MTH_METER_READINGS

Line 132: INSERT INTO MTH_METER_READINGS_ERR

128: IS
129: v_reprocess_ready_yn VARCHAR2(1) := 'N';
130: v_meter_reading_err_pk_key NUMBER;
131: BEGIN
132: INSERT INTO MTH_METER_READINGS_ERR
133: (METER_READINGS_ERR_PK_KEY, TO_TIME, USAGE_VALUE, TAG_CODE,
134: REPROCESS_READY_YN, ERR_CODE)
135: VALUES (MTH_METER_READINGS_ERR_S.NEXTVAL, P_READING_TIME,
136: P_TAG_VALUE, P_TAG_CODE, v_reprocess_ready_yn, P_ERROR_CODE);

Line 135: VALUES (MTH_METER_READINGS_ERR_S.NEXTVAL, P_READING_TIME,

131: BEGIN
132: INSERT INTO MTH_METER_READINGS_ERR
133: (METER_READINGS_ERR_PK_KEY, TO_TIME, USAGE_VALUE, TAG_CODE,
134: REPROCESS_READY_YN, ERR_CODE)
135: VALUES (MTH_METER_READINGS_ERR_S.NEXTVAL, P_READING_TIME,
136: P_TAG_VALUE, P_TAG_CODE, v_reprocess_ready_yn, P_ERROR_CODE);
137:
138: EXCEPTION
139: WHEN others THEN

Line 295: INSERT INTO MTH_METER_READINGS

291: END IF;
292:
293: IF (p_meter_keys_arr IS NOT NULL) THEN
294: FORALL i IN 1..p_meter_keys_arr.Count
295: INSERT INTO MTH_METER_READINGS
296: (METER_FK_KEY, FROM_TIME, TO_TIME, USAGE_VALUE, PROCESSED_FLAG,
297: CREATION_DATE, LAST_UPDATE_DATE, CREATION_SYSTEM_ID,
298: LAST_UPDATE_SYSTEM_ID) VALUES
299: (p_meter_keys_arr(i), v_from_time, p_reading_time,

Line 347: * in MTH_TAG_METER_READINGS_RAW into meter readings table MTH_METER_READINGS *

343:
344: /* ****************************************************************************
345: * Procedure :LOAD_ACT_METER_RAW_TO_READINGS *
346: * Description :Load data from tag meter raw for energy consumption *
347: * in MTH_TAG_METER_READINGS_RAW into meter readings table MTH_METER_READINGS *
348: * for actual meters *
349: **************************************************************************** */
350:
351: PROCEDURE LOAD_ACT_METER_RAW_TO_READINGS(p_curr_partition IN NUMBER)

Line 486: INSERT INTO MTH_METER_READINGS_ERR

482:
483: -- 2.3 Insert data into either meter readings or error table
484: IF (v_err_code IS NOT NULL OR Length(v_err_code) > 0) THEN
485: -- 2.3.1 Insert the error row to error table if there is any error
486: INSERT INTO MTH_METER_READINGS_ERR
487: (METER_READINGS_ERR_PK_KEY, TO_TIME, USAGE_VALUE, TAG_CODE,
488: REPROCESS_READY_YN, ERR_CODE)
489: VALUES (MTH_METER_READINGS_ERR_S.NEXTVAL, r_raw_data.READING_TIME,
490: r_raw_data.TAG_VALUE, r_raw_data.TAG_CODE,

Line 489: VALUES (MTH_METER_READINGS_ERR_S.NEXTVAL, r_raw_data.READING_TIME,

485: -- 2.3.1 Insert the error row to error table if there is any error
486: INSERT INTO MTH_METER_READINGS_ERR
487: (METER_READINGS_ERR_PK_KEY, TO_TIME, USAGE_VALUE, TAG_CODE,
488: REPROCESS_READY_YN, ERR_CODE)
489: VALUES (MTH_METER_READINGS_ERR_S.NEXTVAL, r_raw_data.READING_TIME,
490: r_raw_data.TAG_VALUE, r_raw_data.TAG_CODE,
491: v_reprocess_ready_yn, v_err_code);
492: v_num_insert_update := v_num_insert_update + 1;
493: ELSE

Line 1189: FROM mth_meter_readings

1185: p_from_time IN DATE,
1186: p_to_time IN DATE) IS
1187:
1188: SELECT from_time, to_time, usage_value
1189: FROM mth_meter_readings
1190: WHERE meter_fk_key = p_meter_fk_key AND
1191: to_time >= p_from_time AND
1192: from_time <= p_to_time
1193: ORDER BY from_time;

Line 1484: * load the data into meter readings table MTH_METER_READINGS *

1480: /* ****************************************************************************
1481: * Procedure :cal_virtual_meter_component *
1482: * Description :Calculate all the virtual meters that is power rating*
1483: * based hourly if the components are available and *
1484: * load the data into meter readings table MTH_METER_READINGS *
1485: * File Name :MTHSUSAB.PLS *
1486: * Visibility :Private *
1487: * Parameters :p_meter_pk_key - meter pk key *
1488: * p_virtual_meter_type - virtual meter type. It can be *

Line 1601: * load the data into meter readings table MTH_METER_READINGS *

1597:
1598: /* ****************************************************************************
1599: * Procedure :cal_save_virtual_meter *
1600: * Description :Calculate virtual meter using the component values and *
1601: * load the data into meter readings table MTH_METER_READINGS *
1602: * File Name :MTHSUSAB.PLS *
1603: * Visibility :Private *
1604: * Parameters :p_meter_pk_key - meter pk key *
1605: * p_formula - Virtual meter formula to calculate meter *

Line 1668: INSERT INTO mth_meter_readings

1664: -- 2. Calculate the virtual meter for each hour available
1665: FOR i IN 1..v_numElements LOOP
1666: v_usage_value := calVirtualMeter(c, p_components, i);
1667: v_hour_end_time := v_hour_start_time + 1/24 - 1/86400;
1668: INSERT INTO mth_meter_readings
1669: (meter_fk_key, from_time, to_time, usage_value,
1670: creation_date, last_update_date, creation_system_id,
1671: last_update_system_id, created_by, last_updated_by,
1672: last_update_login, processed_flag) VALUES

Line 1707: * load the data into meter readings table MTH_METER_READINGS *

1703:
1704: /* ****************************************************************************
1705: * Procedure :ADD_VRT_TO_METER_READINGS *
1706: * Description :Calculate all the virtual meters if possible hourly and *
1707: * load the data into meter readings table MTH_METER_READINGS *
1708: * File Name :MTHSUSAB.PLS *
1709: * Visibility :Private *
1710: * Parameters :None *
1711: * Return Value :None *

Line 1727: FROM MTH_METER_READINGS

1723: M.PRECEDENCE, E.ENTITY_FK_KEY, UPPER(E.ENTITY_TYPE) ENTITY_TYPE,
1724: R.END_TIME
1725: FROM MTH_METERS M, MTH_METER_ENTITIES E,
1726: (SELECT meter_fk_key, Max(to_time) end_time
1727: FROM MTH_METER_READINGS
1728: GROUP BY meter_fk_key) R
1729: WHERE M.METER_TYPE = 'VRT' AND M.METER_PK_KEY = E.METER_FK_KEY (+) AND
1730: M.METER_PK_KEY = r.meter_fk_key (+)
1731: ORDER BY M.PRECEDENCE;

Line 1793: FROM mth_meter_readings a, mth_meters b

1789: AS
1790: CURSOR cur_meter
1791: IS
1792: SELECT a.meter_fk_key, a.from_time, a.to_time, a.usage_value, b.meter_code
1793: FROM mth_meter_readings a, mth_meters b
1794: WHERE a.meter_fk_key = b.meter_pk_key
1795: AND a.processed_flag = 'N'
1796: ORDER BY a.meter_fk_key, a.from_time;
1797:

Line 1840: INSERT INTO mth_meter_readings_err

1836:
1837: EXCEPTION
1838: WHEN No_Data_Found THEN
1839: IF SQL%NOTFOUND THEN
1840: INSERT INTO mth_meter_readings_err
1841: (meter_readings_err_pk_key, meter_code, from_time, to_time, usage_value, tag_code, reprocess_ready_yn,
1842: err_code, creation_date, last_update_date)
1843: VALUES (MTH_METER_READINGS_ERR_S.NEXTVAL, reading_rec.meter_code, reading_rec.from_time, reading_rec.to_time,
1844: reading_rec.usage_value, NULL, 'N', 'HRNA', SYSDATE, SYSDATE);

Line 1843: VALUES (MTH_METER_READINGS_ERR_S.NEXTVAL, reading_rec.meter_code, reading_rec.from_time, reading_rec.to_time,

1839: IF SQL%NOTFOUND THEN
1840: INSERT INTO mth_meter_readings_err
1841: (meter_readings_err_pk_key, meter_code, from_time, to_time, usage_value, tag_code, reprocess_ready_yn,
1842: err_code, creation_date, last_update_date)
1843: VALUES (MTH_METER_READINGS_ERR_S.NEXTVAL, reading_rec.meter_code, reading_rec.from_time, reading_rec.to_time,
1844: reading_rec.usage_value, NULL, 'N', 'HRNA', SYSDATE, SYSDATE);
1845: END IF;
1846: EXIT;
1847: WHEN OTHERS THEN

Line 1855: UPDATE mth_meter_readings SET processed_flag = 'Y'

1851:
1852: END LOOP;
1853:
1854: BEGIN
1855: UPDATE mth_meter_readings SET processed_flag = 'Y'
1856: WHERE meter_fk_key = reading_rec.meter_fk_key
1857: AND from_time = reading_rec.from_time;
1858: EXCEPTION
1859: WHEN OTHERS THEN

Line 1876: l_shift_rec_to_time mth_meter_readings.to_time%TYPE;

1872: j NUMBER := 1;
1873: l NUMBER := 1;
1874: l_duration NUMBER;
1875: l_entity_fk_key mth_meter_entities.entity_fk_key%TYPE;
1876: l_shift_rec_to_time mth_meter_readings.to_time%TYPE;
1877: l_new_from_time mth_meter_readings.from_time%TYPE;
1878: l_to_time mth_meter_readings.to_time%TYPE;
1879:
1880:

Line 1877: l_new_from_time mth_meter_readings.from_time%TYPE;

1873: l NUMBER := 1;
1874: l_duration NUMBER;
1875: l_entity_fk_key mth_meter_entities.entity_fk_key%TYPE;
1876: l_shift_rec_to_time mth_meter_readings.to_time%TYPE;
1877: l_new_from_time mth_meter_readings.from_time%TYPE;
1878: l_to_time mth_meter_readings.to_time%TYPE;
1879:
1880:
1881: CURSOR cur_entities (l_meter_fk_key NUMBER)

Line 1878: l_to_time mth_meter_readings.to_time%TYPE;

1874: l_duration NUMBER;
1875: l_entity_fk_key mth_meter_entities.entity_fk_key%TYPE;
1876: l_shift_rec_to_time mth_meter_readings.to_time%TYPE;
1877: l_new_from_time mth_meter_readings.from_time%TYPE;
1878: l_to_time mth_meter_readings.to_time%TYPE;
1879:
1880:
1881: CURSOR cur_entities (l_meter_fk_key NUMBER)
1882: IS

Line 2333: mth_util_pkg.mth_truncate_table('MTH_METER_READINGS');

2329: PROCEDURE truncate_entity_sustain_data
2330: IS
2331: BEGIN
2332: mth_util_pkg.mth_truncate_table('MTH_TAG_METER_READINGS_LATEST');
2333: mth_util_pkg.mth_truncate_table('MTH_METER_READINGS');
2334: mth_util_pkg.mth_truncate_table('MTH_METER_READINGS_ERR');
2335: mth_util_pkg.mth_truncate_table('MTH_ENTITY_SUST_EMISSIONS');
2336: mth_util_pkg.mth_truncate_table('MTH_ENTITY_SUSTAIN_ASPECT');
2337: mth_util_pkg.mth_truncate_table('MTH_ENTITY_SUST_HR_EMISSIONS');

Line 2334: mth_util_pkg.mth_truncate_table('MTH_METER_READINGS_ERR');

2330: IS
2331: BEGIN
2332: mth_util_pkg.mth_truncate_table('MTH_TAG_METER_READINGS_LATEST');
2333: mth_util_pkg.mth_truncate_table('MTH_METER_READINGS');
2334: mth_util_pkg.mth_truncate_table('MTH_METER_READINGS_ERR');
2335: mth_util_pkg.mth_truncate_table('MTH_ENTITY_SUST_EMISSIONS');
2336: mth_util_pkg.mth_truncate_table('MTH_ENTITY_SUSTAIN_ASPECT');
2337: mth_util_pkg.mth_truncate_table('MTH_ENTITY_SUST_HR_EMISSIONS');
2338: mth_util_pkg.mth_truncate_table('MTH_ENTITY_SUSTAIN_ASPECT_HOUR');