I have a select query in a cursor with a "where" clause

I want to insert into a table the value of the "where" parameter in case the select statement doesn't return any value

[the no_data_found exception in Oracle]

I tried the the exception 100 :

ON EXCEPTION IN
( 100, -- NO data found ) SET err_num
IF err_num = 100 THEN .....

but it does NOT work

Am I doing something wrong ?
Is there another code ?

Thanks