How to you get the package name of a stored procedure – DB2

Some times you need get the package name to do some tasks ….like for Ex: db2expln with -p option where -p represents package name

Well if that is the case this query might help you in getting the package name

The catalog tables you have to use are SYSCAT.PROCEDURES and SYSCAT.ROUTINENAME

select substr(procname,1,20) as procname , bname as packname from syscat.proceduers , syscat.routinedep where syscat.procedures.specificname = syscat.routinedep.routinename and syscat.procedures.procname = ‘ PROCEDURE_NAME ‘

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s