Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help on PL/SQL
Shawn Odekirk <shawno_at_erudite.com> wrote:
> > 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.
> >
> 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.
Imho, it's always appropriate to include a (hopefully tested) illustration of solutions. Many use this forum not only to get answers to specific problems but also to learn more about the products that we use. In my case, I'm a new DBA && PL/SQL programmer with a need to learn as much as I can as _fast_ as I can. This forum supplements my other sources, and it has been a great tool -- partly because of the included script snippets.
Cheers,
gary -=- visit The C Programmers' Reference -=- http://users.southeast.net/~garyg/C_ref/C/c.html The AVENUE Programmers' Class Requests http://users.southeast.net/~garyg/class.htmReceived on Sun Mar 23 1997 - 00:00:00 CST
![]() |
![]() |