454: --added for performance issues
455: select initial_reading into l_initial_reading from
456: (select initial_reading from CSI_COUNTERS_B where counter_id = a_pm_rule.meter_id
457: union
458: select initial_reading from CSI_COUNTER_TEMPLATE_B where counter_id = a_pm_rule.meter_id
459: );
460: select EAM_LAST_CYCLIC_ACT into l_last_act from eam_pm_schedulings
461: where pm_schedule_id = l_pm_schedule_id;
462:
1809: --added for perofrmance issues
1810: select 1 into l_count from dual where exists
1811: (select COUNTER_ID from CSI_COUNTERS_B where counter_id = p_pm_rule_rec.meter_id
1812: union
1813: select COUNTER_ID from CSI_COUNTER_TEMPLATE_B where counter_id = p_pm_rule_rec.meter_id) ;
1814:
1815:
1816: if (l_count=0) then
1817: x_reason_failed:='EAM_PM_RUN_INVALID_METER_ID';
1823: --added for perofrmance issues
1824: select direction into l_value_change_dir from
1825: (select direction from CSI_COUNTERS_B where counter_id = p_pm_rule_rec.meter_id
1826: union
1827: select direction from CSI_COUNTER_TEMPLATE_B where counter_id = p_pm_rule_rec.meter_id);
1828:
1829: if ((l_value_change_dir='A' -- ascending
1830: and p_pm_rule_rec.effective_reading_from > p_pm_rule_rec.effective_reading_to)
1831: or