Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help on PL/SQL
> Hi,
>
> I have a question to ask:
>
> I need to create a stored procedure which contains a string
> type parameter, say
>
> CREATE OR REPLACE proc_1(fieldname CHAR)
> ....
>
> Now, suppose the actual parameter I am passing is a field
> name in a table, my question is How I am able to run a
> SQL statement, something like this:
>
> SELECT "fieldname" from table1;
>
> Is there any way to do this? Any input is highly appreciated.
>
> Thanks.
>
> BC
You need to use the DBMS_SQL package. It contains functions to create an SQL
statement on the fly an execute it.
If there is interest I can post a sample here.
Shawn Received on Fri Mar 21 1997 - 00:00:00 CST