问题
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