I have data value of a table column. I want to know in which database and in which table and in which column the data value appeared in mysql.

You'd have to loop through each database, table and column. Are you looking for code to do that ?

You'd have to loop through each database, table and column. Are you looking for code to do that ?

Yes, i am looking for that code...

In MySql, or an other language ?

In MySql, or an other language ?

In MySql...

I know you'd have to use SHOW DATABASES, SHOW TABLES and SHOW COLUMNS, but how to use them correctly in a mysql procedure is a little out of my league. Am not sure how to check for the right datatype to match your value. Hopefully someone else will pick this up.

I know we can loop through all data base using INFORMATION_SCHEMA.TABLE
But I want better solution with optimum code.

is it possible to use data structure concept to find this.

What means "optimum code" ? In number of code lines? In performance? In usability?
Maybe I would try to solve this not in MySQL but in plain text format on a dump file with regular expressions (grep or, in PHP, preg). This could be the optimum in coding efficiency.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.