Hi All,
The trigger below gets compiled succesfully, however it doesnt work as expected, what we want is when count not = 0 then it shd raise the error. somehow its not working
please help
regards
Anil
create or replace trigger Tr_CheckSRID
before insert or update of SR_ID on DTS_T_VIC_VOLUME
for each row
declare
temp Varchar(2);
cursor c1 is select count(*) Countsr from DTS_T_VIC_VOLUME WHERE SR_ID not in ( select distinct SR_ID from T_SR_Salesperson_Details) ;
begin
for temp in c1
loop
if temp.Countsr <>0 then
RAISE_APPLICATION_ERROR (-20107,'SR ID doesnt exists in column T_SR_Salesperson_Details');
end if;
end loop;
Exception
when no_data_found then
RAISE_APPLICATION_ERROR (-20100,'No data found on table T_SR_Salesperson_Details');
end Tr_CheckSRID ;
The trigger below gets compiled succesfully, however it doesnt work as expected, what we want is when count not = 0 then it shd raise the error. somehow its not working
please help
regards
Anil
create or replace trigger Tr_CheckSRID
before insert or update of SR_ID on DTS_T_VIC_VOLUME
for each row
declare
temp Varchar(2);
cursor c1 is select count(*) Countsr from DTS_T_VIC_VOLUME WHERE SR_ID not in ( select distinct SR_ID from T_SR_Salesperson_Details) ;
begin
for temp in c1
loop
if temp.Countsr <>0 then
RAISE_APPLICATION_ERROR (-20107,'SR ID doesnt exists in column T_SR_Salesperson_Details');
end if;
end loop;
Exception
when no_data_found then
RAISE_APPLICATION_ERROR (-20100,'No data found on table T_SR_Salesperson_Details');
end Tr_CheckSRID ;