Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL question: how to use a parameter of a procedure as a table name for select statement???

Re: PL/SQL question: how to use a parameter of a procedure as a table name for select statement???

From: Knut Talman <knut.talman_at_mytoys.de>
Date: Fri, 19 Apr 2002 16:21:42 +0200
Message-ID: <3CC027F6.2050701@mytoys.de>


> I want to write a procedure to process a table but the table name
> and the col name are passed in the procedure as parameters.
>
> Inside the procedure, I will have a select statement as follows:
>
> select <colName> from <tableName>
>
> where colName and tableName are passed in as arguments.
>
> Is this possible? If so, how to do it?

Yes, it is. Have a look at dynamic SQL (google will tell you alot about it).

Regards,

Knut Received on Fri Apr 19 2002 - 09:21:42 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US