If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > getting parameters of SP

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-05-07, 09:27
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
getting parameters of SP

apart from looking in catalog tables ,is there any way by which
i can get ddl for SP or atleast their parameters
same way as we can do in tables or indexes

describe table eone.tsys_user_mstr
describe indexes for table eone.tsys_user_mstr

--Rahul Singh
__________________
Rahul Singh
Certified DB2 9 DBA / Application Developer
Reply With Quote
  #2 (permalink)  
Old 01-17-07, 09:12
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
"describe table" also only looks at the catalog - and reformats the output a bit.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #3 (permalink)  
Old 01-17-07, 09:45
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
If the SP is SQL, then "select text from syscat.routines where routineschema = ? and routinename = ?" will get you the entire CREATE PROCEDURE statement. I do not know how to get this for a non_SQL SP.

If you just want the parameters:

select parmname,case rowtype when 'B' then 'INOUT' when 'C' then 'Result after Casting' when 'O' then 'OUT' when 'P' then 'IN' when 'R' then 'Result before Casting' else '??' as type, typeschema,typename,length,scale from syscat.routineparms where routineschema = ? and routinename = ?

HTH

Andy
Reply With Quote
  #4 (permalink)  
Old 01-17-07, 09:55
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
All metadata for the various database objects is stored in the DB2 catalog tables (which should only be accessed through the views in the SYSCAT schema). You can use this metadata to piece together the CREATE PROCEDURE statements for non-SQL SPs. This is exactly what the "db2look" tool is doing.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On