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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Tablename variable. How To?

Re: Tablename variable. How To?

From: Helmut Hahn <helmut.hahn_at_bitoek.uni-bayreuth.de>
Date: Thu, 22 Jul 1999 10:16:29 +0200
Message-ID: <3796D35D.9F82BA65@bitoek.uni-bayreuth.de>

Kenneth Herskedal wrote:

> I have a table name stored in a CHAR(15). I want to performe a select
> statement on this table.
>
> How can I use this variable in the SQL?
>
> tt char(15)
> ..
> fetch stat into tt;
> select * from tt; -- Not working!!
>

You could build a function gettablename returning this char and then try select * from (select gettablename() from dual); or direct
select * from (select tt from dual); (Don't know if this works!)

The main point is that the tablename can be a result of a select and that should be the key to go ahead!

>
> Thanks in advance.

Helmut Received on Thu Jul 22 1999 - 03:16:29 CDT

Original text of this message

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