130: BEGIN
131: Begin
132: select 'x'
133: into l_exists
134: from CSI_CTR_ESTIMATED_READINGS
135: where estimated_reading_id = p_estimated_rdg_id;
136: l_return_value := TRUE;
137: Exception
138: when no_data_found then
6672: --
6673: -- Generate the Value_id for insert
6674: l_process_flag := TRUE;
6675: WHILE l_process_flag LOOP
6676: select CSI_CTR_ESTIMATED_READINGS_S.nextval
6677: into l_estimated_rdg_id from dual;
6678: IF NOT Estimated_Rdg_ID_Exists(l_estimated_rdg_id) THEN
6679: l_process_flag := FALSE;
6680: END IF;
6679: l_process_flag := FALSE;
6680: END IF;
6681: END LOOP;
6682: --
6683: CSI_CTR_ESTIMATED_READINGS_PKG.Insert_Row
6684: (
6685: px_ESTIMATED_READING_ID => l_estimated_rdg_id
6686: ,p_COUNTER_ID => p_counter_id
6687: ,p_ESTIMATION_ID => l_estimation_id