I'm trying to obtain an specific value in all my schema. I found similar post but, are oriented in know column names, but my current problem is: I have an schema with 320 tables and some specific values to search in some(s) of these tables. Is possible do a similar search?
Asked
Active
Viewed 66 times
0
-
If this is a one-off requirement, you could make a database dump and search that. If it's a permanent feature, you might want to look at a separate indexing server, such as Solr or Xapian – IMSoP Apr 12 '14 at 15:39
-
Actually, looking at the linked question, I don't understand the difference between your question and that one. – IMSoP Apr 12 '14 at 15:41
-
Is a one time requirement, just now, i have listed all my table names with: `select * from information_schema.tables WHERE table_schema = 'my_schema' and table_type = 'BASE TABLE'` , but, I am trying to search the content into of these tables. is possible? – Benjamin RD Apr 12 '14 at 15:41
-
@IMSoP in the reference link, finally, the queries are of specific tables like the last answer, I'm trying obtain for example the text `LIKE 'DTD%'` but, this text could be contained in X records in the tables in the schema. – Benjamin RD Apr 12 '14 at 15:48
-
1The accepted answer shows a search across the whole database, with no foreknowledge of which tables or columns will show up in the output. – IMSoP Apr 12 '14 at 15:58
-
@a_horse_with_no_name I'm not totally sure, I mean, for example, how I can do something like: `SELECT * from information_schema.X where x.x = LIKE 'DTD%'` and display related records? – Benjamin RD Apr 12 '14 at 16:04
-
So to be clear you want to search column names in all tables? – Kuberchaun Apr 12 '14 at 19:01
-
I've replied in the duplicate with a function that's more useful for your problem than grep in dump: see http://stackoverflow.com/a/23036421/238814 – Daniel Vérité Apr 12 '14 at 21:39