use DBMS_DESCRIBE. it's available in 8i.
see: http://docs.oracle.com/cd/A87860_01/doc/index.htm
if the procedure of function doesn't exist, it will return an ORA-20001 error.
eg
declare
V_YOUR_PROC_NAME varchar2(100) := 'MY_PACK.FUNC';
function proc_exists(p_name varchar2) return boolean
is
overload dbms_describe.number_table;
position dbms_describe.number_table;
c_level dbms_describe.number_table;
arg_name dbms_describe.varchar2_table;
dty dbms_describe.number_table;
def_val dbms_describe.number_table;
p_mode dbms_describe.number_table;
length dbms_describe.number_table;
precision dbms_describe.number_table;
scale dbms_describe.number_table;
radix dbms_describe.number_table;
spare dbms_describe.number_table;
idx integer := 0;
PROC_NOT_FOUND exception;
pragma exception_init(PROC_NOT_FOUND, -20001);
begin
dbms_describe.describe_procedure(
p_name,null,null,
overload,position,
c_level,arg_name,
dty,def_val,p_mode,
length,precision,
scale,radix,spare);
return true;
exception
when PROC_NOT_FOUND
then
return false;
end;
begin
if (proc_exists(V_YOUR_PROC_NAME))
then
dbms_output.put_line(' found');
else
dbms_output.put_line(' not found');
end if;
end;