Solved

dynamic query

Posted on 2011-03-07
3
250 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 77

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
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…

718 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