Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 14th, 2004, 06:17 AM
aturserviss aturserviss is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 5 aturserviss User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Query On All Tables

Hi,

Our Oricle 9i database has several thousand tables in it. I want to create a query against all the tables in the db (table name unknown) to determine which table(s) contains the element N_REPORT_DT, for example, and display a list of those tables where N_REPORT_DT is a part of. Can this be done through SQL? How would the SQL be written? Thank you.

Reply With Quote
  #2  
Old April 14th, 2004, 07:57 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 17,957 r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 16 h 6 m 16 sec
Reputation Power: 1024
yes, it can be done, either by querying some INFORMATION_SCHEMA tables (assuming oracle supports these) or else by querying oracle's system catalog tables

unfortunately i don't know how, and this is the mysql forum

but i'm an admin, and i recommend that i move this question into the oracle forum, where i am sure you will find some knowledgeable oracle people

agreed?
__________________
r937.com | rudy.ca

pre-order my book Simply SQL from Amazon

Reply With Quote
  #3  
Old April 14th, 2004, 08:22 AM
aturserviss aturserviss is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 5 aturserviss User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yes, please do. Thank you.

Reply With Quote
  #4  
Old April 14th, 2004, 12:00 PM
shafique shafique is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Canada
Posts: 305 shafique User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 45 m 20 sec
Reputation Power: 6
In Oracle LIKE operator is used to perform pattern matching, The pattern search character % is used to match any character and any number of characters. The pattern search character _ is used to match any single character. If you are looking for the actual % or _ in the pattern search, you can include an escape character in the search string and notify Oracle using the ESCAP clause. For example:

SELECT * from dba_objects
WHERE object_name like '%N\_REPORT\_DT%' ESCAPE '\'
/

Regards,

Reply With Quote
  #5  
Old April 14th, 2004, 12:07 PM
aturserviss aturserviss is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 5 aturserviss User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you. Do I use a similar approach when I know the object name but do not know the table name where the object resides? I'm seaching for every table (17,000+ tables) that attempting to identify the ones that contains the object.

Reply With Quote
  #6  
Old April 14th, 2004, 01:47 PM
shafique shafique is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Canada
Posts: 305 shafique User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 45 m 20 sec
Reputation Power: 6
yes, you could.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Query On All Tables


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT