-1

I want writing a procedure in MySQL which searching a UserId which we write example

call NEW_PROCEDURE(2) 

where 2 = UserId which we want search in all tables. I have an idea but I dont know how do it. First we must search all columns in database where column_name = UserId and Second we must search a value that we called in the procedure and UserId = our value

Can somebody help me ?

  • Hope following links will help you [StackOverflow Similar Question #1][1] [StackOverflow Similar Question #2][2] [1]: http://stackoverflow.com/questions/11624611/mysql-tool-that-searches-for-a-string-in-all-fields-tables-and-databases [2]: http://stackoverflow.com/questions/639531/mysql-search-in-all-fields-from-every-table-from-a-database – jsist Jul 27 '12 at 10:11

1 Answers1

0

This will give you an idea http://beyondrelational.com/modules/2/blogs/70/posts/10883/search-a-value-in-character-column-of-all-tables.aspx

1 Use concat instead of +
2 Use prepared statement to exeucte the query
3 Information_schema is supported in mysql too
Madhivanan
  • 13,470
  • 1
  • 24
  • 29