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

前端 未结 2 1221
终归单人心
终归单人心 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:53

    The accepted answer didn't work for me for our particular flavor of DB2, but it set me in the right direction. Here is the query I wrote which allowed me to search sprocs in a given schema:

    SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM sysibm.routines 
    WHERE SPECIFIC_SCHEMA='' 
        AND ROUTINE_DEFINITION LIKE '%'
    

    Replace YourSchemaName and YourSearchText with appropriate values.

提交回复
热议问题