Interesting question. As APC noted, Oracle doesn't have reflection per say like other languages, so passing in the name (varchar2) doesn't help Oracle much (esp at compile time). What I believe you are saying here is that you have a set of tables that all share certain characteristics (1 or more columns of the same type used in the same way), so you want to make a generic function that will work for any of them.
You can do this, but you'll have to define an object type that defines the common columns and types that your various tables share. Say this is the following 2 columns:
create or replace type my_obj as object (name varchar2(100), num number);
Now your function (or procedure) would accept this type as a param:
create or replace function my_fn(obj my_obj) return varchar2 is
begin
-- do something with object
return obj.name || ',' || obj.num;
end;
And you'd call it like:
declare
obj my_obj;
rv varchar2(1000);
begin
for rec in (select * from sometable)
loop
obj := my_obj(rec.some_varchar_col, rec.some_number_col);
select my_fn(obj) into rv from dual;
dbms_output.put_line(rv);
end loop;
end;
The only other way that I can think of is to accept a weakly typed sys_refcursor and then force calling procs to send in a correct cursor (risky due to potential runtime exceptions and not very clear). I prefer the above approach if coding a "generic" function.
EDIT
To be complete, I'll throw in the sys_refcursor example I mentioned above:
create or replace procedure my_proc(cur sys_refcursor) is
v_name varchar2(100);
v_num number;
begin
loop
fetch cur into v_name, v_num;
exit when cur%notfound;
-- do something with our common fields
dbms_output.put_line(v_name || ',' || v_num);
end loop;
end;
And call it like:
declare
v_cur sys_refcursor;
begin
open v_cur for select my_name, my_num from some_table;
my_proc(v_cur);
close v_cur;
end;
NOTE
This seems overly trivial with just 2 columns (why not just set params as varchar2 and number), but you may have dozens of columns that you want to work on in the function, and the input object can have any number of them populated.
Cheers