Solved

dynamic query

Posted on 2011-03-07
3
247 Views
Last Modified: 2012-06-21
What is the best way to replace the two table names with the 700 tables names in my schema?

select table_name from user_tables where table_name in ('TIOR','TIIN')
0
Comment
Question by:msimons4
3 Comments
 
LVL 23

Accepted Solution

by:
wdosanjos earned 167 total points
ID: 35060638
Please try:

SELECT TABLE_NAME FROM ALL_TABLES WHERE OWNER = '<< your schema name >>'
0
 
LVL 76

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 166 total points
ID: 35061544
What do you mean 'replace'?  Are you wanting to physically rename the tables?

If you do, what about all the constraints/indexes/foreign keys on them?
0
 
LVL 28

Assisted Solution

by:Naveen Kumar
Naveen Kumar earned 167 total points
ID: 35063339
if you are interested only in your tables, then you can query USER_TABLES :

SELECT TABLE_NAME FROM USER_TABLES ;

if you are interested in all your tables + any tables on which you have got privileges, then use the below :

select table_name from ALL_tables ;

select table_name from ALL_tables where OWNER = 'SCOTT' ; -- to find only those which are owned by SCOTT user by you have privileges on them. change SCOTT to your user name accordingly.

If you are interested to find all table names in the database, then you can query DBA_TABLES

select table_name from DBA_tables where owner ='TEST_USER';  -- change test_user to actual user name

select table_name from ALL_tables ;
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to recover a database from a user managed backup

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question