Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: using table pointers in select?
On Aug 9, 11:09 am, "aksel.schmidt" <axl.schm..._at_gmail.com> wrote:
> 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
Out of interest, why would the table name not be known at compile time, when apparently the column list is? Received on Fri Aug 10 2007 - 07:15:30 CDT
![]() |
![]() |