create or replace test(string tableName,string colName) as ... begin select ... into ... from '||tableName; ... end test;
create function getva(p_bm in varchar2,p_zdm in varchar2) return varchar2 as va varchar2(20); str varchar2(50); begin str:='select '||p_zdm||' from '||p_bm||' where ...'; execute immediate str into va; return va; end; /
as
...
begin
select ... into ... from '||tableName;
...
end test;
return varchar2
as
va varchar2(20);
str varchar2(50);
begin
str:='select '||p_zdm||' from '||p_bm||' where ...';
execute immediate str into va;
return va;
end;
/