2

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.

2 Answers 2

12

Cut down the details... this will just show you the procedure names:

SELECT procname FROM syscat.procedures WHERE procschema = 'MYSCHEMA'

0

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.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.