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: help!! How to set tablename variable?

Re: help!! How to set tablename variable?

From: Bob Bain <bob.bain_at_terra-nova.e-mail.com>
Date: Thu, 16 Dec 1999 09:51:10 -0000
Message-ID: <hD264.6$654.437@news.colt.net>


You can pass a table name to a stored prcoedure as an argument, but the you would have to use Dynamic SQL to select from the table.

Depends what version of ORACLE oyou are on as to which Dynamic SQL construct you shoudl use.

From 7.3 see the DBMS_SQL package.

lkw <lkw_at_axiomatique.com> wrote in message news:83a1c0$otu$1_at_newton3.pacific.net.sg...
> hi everybody,
>
> say i want to pass a tablename variable (v_tblname) into a stored
procedure
> to perform a sql statement.
> Inside my stored proc i wrote:
>
> select * from v_tblname;
>
> but i always encountered errors. so i just want to know that is there a
way
> to set a table name as a variable? if yes, how?
>
> yr helf would be greatly appreciated!! thanks!!
>
> lkw.
>
>
Received on Thu Dec 16 1999 - 03:51:10 CST

Original text of this message

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