When you are working with Database systems, very often you will be stuck in a situation where you vaugely remember the column name but doesn’t know which TABLE the COLUMN belongs to. I’ve been in this situation more than a dozen times myself. I blame my bad memory for this.
Well, here is a small SQL query that does the trick for you.
SELECT TABLE_NAME,COLUMN_NAME FROM USER_TAB_COLUMNS WHERE COLUMN_NAME like ‘%customer_id%’;
Replace the “customer_id” with the text that you would like to search for.
This works for a Oracle Database. I haven’t tried this with MySQL.
Please use the comment box for any suggestions.
Please bookmark this site.
This entry was written by
and posted on April 20, 2009 at 10:30 pm and filed under , . Bookmark the . Follow any comments here with the .
or leave a trackback: .
No comments yet.
Leave a comment
Theme : Powered by :