In db2 how to find all the Stored Procedures having a given text in it

前端 未结 2 1222
终归单人心
终归单人心 2021-01-28 13:17

I want to find if a table is being used anywhere in all the stored procedures in a system. Is there a query to fetch all the details of SP.

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-28 13:39

    You can use SYSCAT.TABDEP and SYSCAT.ROUTINEDEP system catalog views.

    For tables in Dynamic SQL statements, that are built and executed on the fly, you can use

    select routinename,text from syscat.routines where language='SQL' and locate('',text)>0
    

    HTH

    Sathyaram

提交回复
热议问题