How do I list all stored procedures in Informix?

回眸只為那壹抹淺笑 提交于 2019-11-30 15:29:54

问题


I'm looking for a way to list all the stored procedures in my database running on Informix.

Is there a table in the "informix".* database that lists stored procedures along with detail information about them?


回答1:


Yes, there is. It's called sysprocedures. Try this to see all there's to see:

select * from sysprocedures

For more information on what detailed information is available, read about sysprocedures and sysprocbody and sysproccolumns.




回答2:


select sysprocedures.procname from sysprocedures;



回答3:


Get the procid of the stored procedure from the below query

select sysprocedures.procname,sysprocedures.procid from sysprocedures

and provide the procid in the below query to view the whole stored procedure

select data from sysprocbody where procid = @procid and datakey = 'T' order by seqno




回答4:


You can get the contents of the stored procedures (the text) with dbschema: dbschema -d -f all or dbschema -d -f

The text of the procedure is also in the sysprocbody table "where datakey='T'"

so: select data from sysprocbody where procid in (select procid from sysprocedures where procname='') and datakey='T' order by seqno; -- Note that in older Informix, this would complain that seqno had to be included in the list of selected columns.



来源:https://stackoverflow.com/questions/6958886/how-do-i-list-all-stored-procedures-in-informix

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!