Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> using table pointers in select?
hi all
is it possible to use a 'pointer' like reference to a table? i want to write a function that should select from a table that is not known at compile time (but referenced in argument list)
like:
CREATE OR REPLACE FUNCTION "TEST"."DUMTEST" (tablename in varchar)
return number
is
returnValue number;
CURSOR c1
IS (SELECT count(*) from all_objects); -- here i want to
use the 'tablename' argument instead of 'all_objects' which is only
here for compilation right now
begin
open c1;
fetch c1 into returnValue;
if c1%notfound then
returnValue:=0;
end if;
close c1;
RETURN returnValue;
end;
i can resolve the object id for the table using the 'all_objects' view - but how can i make this reference into a table to select from?
thanks!
/aksel Received on Thu Aug 09 2007 - 05:09:14 CDT
![]() |
![]() |