'db2 list of stored procedure in a database
I would like to have the list of stored procedure created in a certain database. I tried
db2 "display procedure MyDb.*"
But I get error
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0104N An unexpected token "procedure" was found following "display ".
Expected tokens may include: "JOIN <joined_table>". SQLSTATE=42601
In another forum I read that I have to query the table syscat.procedures
but if I call
db2 "select * from syscat.procedures"
I get a lot of data I cannot really understand.
Solution 1:[1]
Cut down the details... this will just show you the procedure names:
SELECT procname FROM syscat.procedures WHERE procschema = 'MYSCHEMA'
Solution 2:[2]
Instead of querying the syscat.procedures table directly, try using the SQLProcedures() stored procedure instead. There are a number of input parameters you can use to customize your result.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Uwe Allner |
Solution 2 | Dharman |