Please excuse me for mixing C++ style with a little bit of PL_SQL, but I hope my question comes over correctly and that there is a way to do this in our ORACLE database. My plan is the run the SQL statement as needed to load the necessary procedures onto our daily backup database. They will get deleted each night, and I can’t save them on the production database. I am dealing with a fairly complex table constraint structure. I wrote a script to find all the constraints of one table within all the other tables (who-is-referencing-this-item-constraints-t7777 on this website) (they won't let me port the real link yet) and it works great, but it does indicate that there are a lot of places where the “ITEM” is reference “AS” ITEM_SOLD or ITEM_BOUGHT or some other column name. Now that I know where everything is referenced, I want to simplify things a bit. I want to be able to store a temporary stored procedure for when I need it, and then enter something like: CALL WHERE_IS_ITEM_REFERENCED(‘123’); And the response should be something like: 123 is referenced as ITEM in STORE.Customer 5 times 123 is referenced as ITEM_BOUGHT in BACK_OFFICE.Vendor 3 times Nothing is displayed for the tables that do not reference this item ID PROCEDURE WHERE_IS_ITEM_REFERENCED ( pItem IN thisItem ) BEGIN call INNER_PROC(‘STORE.Customer’,’ ITEM’,thisItem); call INNER_PROC(‘BACK_OFFICE.Vendor’,’ ITEM_BOUGHT’,thisItem); call INNER_PROC(‘ STORE.Sales,’ ITEM,thisItem); END PROCEDURE INNER_PROC( pTable IN tableName, pColumn IN columnName, pItem IN thisItem ) BEGIN SELECT COUNT(*) FROM pTable WHERE pColumn=thisItem; If count > 0 Output thisItem referenced as pColumn in pTable COUNT times; END How is this supposed to be written?