Simpler Navigation coming for Servers and Operating Systems
Coming soon: a much simpler Servers and Operating Systems section of the Community. We will combine many of the older boards, and you won't have to click through so many levels to get at the information you need. If you are looking for an older board and do not find it, check the consolidated boards, as the posts are still there.
cancel
Showing results for 
Search instead for 
Did you mean: 

Global Scan

Prabhu_7
Frequent Advisor

Global Scan

Is that possible to do a global scan on database and find
out which are the tables that has a particular string value.

Say "Investments".

I need to know which are the user tables has "Investments" as part of data ( In any of the records).

Raj
2 REPLIES
Radim Jarosek
Regular Advisor

Re: Global Scan

Hi,

you can create simple procedure to go through all your tables to find a string value.

Radim
A. Clay Stephenson
Acclaimed Contributor

Re: Global Scan

Since you didn't bother to Identify your database, it's difficult to be too specific.

I'll get you started.

Phase 1)
Extract the table names and column names for any character columns. e.g. Oracle
SELECT TABLE_NAME, COLUMN_NAME FROM ALL_TAB_COLUMNS WHERE DATA_TYPE LIKE '%CHAR';

Phase 2)
Compare the extracted column names with your target string.

I would tend to do this in two SQL runs letting the Phase 2 select be built using the data from Phase 1.


In any event, this is going to be a slow process.
If it ain't broke, I can fix that.