oracle8.1.6
select count(*) as duplicate
from dual
where exists (select option_id
from ttracker_options
where package_id = :package_id
and function = :function
and (value = :value or upper(name) = upper(:name)))
begin
ttracker_option.add_option (
package_id => :package_id,
function => :function,
name => :name,
value => :value
);
end;