Hi,
I'm having a procedure in which the Exception block is not working properly . I'm pasting a sample code from the original code itself :
declare
v_date varchar2(30);
v_tabr varchar2(30);
v_received number(10);
begin
SELECT TRUNC(EVT_DTTM), COUNT(*) FROM CDR_EVENT160417 ------ This will give me the number of records present in table CDR_EVENT160417.
GROUP BY TRUNC(EVT_DTTM) '
INTO v_date, v_received; ------ v_date will consist of the respective date & v_received will have the recordcount of that respective date.
--dbms_output.put_line(v_date);
--dbms_output.put_line(v_received);
insert /*+ append*/into BTC_weekly_cdr (CDR_DATE,Received)
values (v_date1,v_received);
commit;
Exception
when OTHERS then
v_received :=0;
dbms_output.put_line(v_received);
end;
I think ; if this block doesn't get any data from table CDR_EVENT160417, it should raise NO_DATA_FOUND exception.
This is handled in the exception block as mentioned above. I can see it's assigning the value 0 to the variable "v_received" ( Through the dbms_output in exception block ).
However, it's not inserting anything into the table "BTC_weekly_cdr " & whenever I'm querying it, I'm unable to view any entry ; i.e. "0" is not being inserted in the "Received" column of table "BTC_weekly_cdr ".
Can anyone suggest me what I'm doing wrong over here. Thanks for your valuable times in advance