| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: giving tablenames to functions or procedures
Michael Brohl wrote <6gftht$pbt$1_at_news00.btx.dtag.de> ...
>Is there any way to give tablenames to functions or
>procedures and how can I refer to them?
>
>e.g.
>
> create function Test
> (cTabName CHAR)
> RETURN CHAR IS
> .
> .
> BEGIN
> .
> .
> SELECT Testfield FROM cTabName;
> .
> .
> END;
> /
>
>This example doesn't work, because the compiler didn't know
>if the specified table is accessable at runtime.
That's right!
any "select" staitment in Oracle's PL/SQL procedure/function is "static
SQL".
What U need - Dynamic SQL. See DBMS_SQL package specification.
Anatoly/ Received on Fri Apr 10 1998 - 00:00:00 CDT
![]() |
![]() |