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: Ron Santillano <Ron_at_Santillano.net>
Date: Fri, 19 Apr 2002 23:20:48 -0700
Message-ID: <uc21vu20b3fo3b@corp.supernews.com>


Try using dynamic SQL - its really easy with 817 - just assign your statement to a variable then Execute Immediate (yourvariable);

"Terrence Leung" <terrencel_at_eseenet.com> wrote in message news:c28a8512.0204190614.1e257836_at_posting.google.com...
> I have a question on PL/SQL (Oracle 817)
>
> 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?
>
> Thanks,
> Terrence
Received on Sat Apr 20 2002 - 01:20:48 CDT

Original text of this message

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