<p>In trying to figure out <a href="https://stackoverflow.com/questions/52981/cannot-delete-from-the-database">this problem</a> (which is still unsolved and I still have no clue what is going on), I am wondering if maybe an external reference to the table in question is causing the problem.  For example, a trigger or view or some other such thing.</p>

<p>Is there an easy way to find all references to a given database table?  Including all views, triggers, constraints, or anything at all, preferably from the command line, and also preferably without a 3rd party tool (we are using db2).</p>

[{'answer_id': 53287, 'author': 'castaway', 'author_id': 4840, 'author_profile': 'https://Stackoverflow.com/users/4840', 'pm_score': 3, 'selected': True, 'text': '<p>Wow, I wouldn\'t have thought it, but there seems to be.. Good ole DB2.</p>\n\n<p>I find the publib db2 docs view very very handy by the way:</p>\n\n<p><a href="http://publib.boulder.ibm.com/infocenter/db2luw/v8//index.jsp" rel="nofollow noreferrer">http://publib.boulder.ibm.com/infocenter/db2luw/v8//index.jsp</a></p>\n\n<p>I just found the "SYSCAT.TABDEP" catalog view in it, which seems to contain more or less what you asked for. I suspect for anything not covered there you\'ll have to trawl through the rest of the syscat tables which are vast. (Unfortunately I can\'t seem to link you to the exact page on SYSCAT.TABDEP itself, the search facility should lead you to it fairly easily though).</p>\n\n<p>Most databases these days have a set of tables which contain data about the layout of your actual schema tables, quite handy for this sort of thing.</p>\n'}, {'answer_id': 53293, 'author': 'Booji Boy', 'author_id': 1433, 'author_profile': 'https://Stackoverflow.com/users/1433', 'pm_score': 0, 'selected': False, 'text': '<p>You can write a query search the information schema views (definition column) to find the table in all views, triggers, procedure, etc. Not sure about FK &amp; indexes though.   </p>\n'}]
['https://Stackoverflow.com/questions/53136', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/122/']