Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Tablename variable. How To?
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
![]() |
![]() |