1753909 Members
8723 Online
108810 Solutions
New Discussion юеВ

Re: 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 2
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.