create or replace function sn_check_type (p_object_id integer,
                                          p_object_type_id integer)
return integer
as
   result integer;
begin
   select decode(object_type_id, p_object_type_id, 1, 0) into result
     from sn_objects
    where object_id=p_object_id;
   return result;
end;
/
show errors
