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!!
>
> Thanks in advance.
In oracle 7, you need to use dbms_sql.
(To see how, do
select text
from dba_source
where name = 'DBMS_SQL'
and type = 'PACKAGE'
order by line
In oracle8, check out "execute_immediate"
HTH
--
"Some days you're the pigeon, and some days you're the statue." Received on Tue Jul 20 1999 - 08:40:07 CDT
![]() |
![]() |