0

I got MySQL database from my client and it has lot of stored procedures. The problem is that some of the stored procedures contain wrong table names (table names that do not exist). So is there a mechanism I can find those wrong table names in stored procedures?

hotcoder
  • 3,176
  • 10
  • 58
  • 96

1 Answers1

0

Check whether table exist or not using following command.

SHOW TABLES LIKE 'yourtable';

If table exist then it will return table name,if not exist then it will return 0 row.

Sush
  • 307
  • 3
  • 14
  • He dont want to do it manually. He wants to compare `foreach(entry in table.column) if entry == existing table => Show tables`. Unfortunately I cant get it using joins. – C4d Dec 03 '14 at 08:56
  • Ok then write only `SHOW TABLES` – Sush Dec 03 '14 at 08:58
  • how will i get table name from store procedure and where you have to implement it means in query or store procedure – Sush Dec 03 '14 at 09:00
  • I want to run a query or something that checks every stored procedure uses correct table names – hotcoder Dec 03 '14 at 14:05