Blog
DB2utor

« Old Xephon Articles Still Available | Main | Index-Only Access Reduces Getpages »

March 15, 2010

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83545a5d153ef01310fa1ad82970c

Listed below are links to weblogs that reference Stored Procedures and DB2:

Comments

Mark

The TS parameter needs to be in quotes.

call sysproc.admin_command_db2('-dis db(*) sp(*) restrict limit(*)', 34,'TS',null,?,?,?,?,?,?,?,?)

Abhay

Has anyone tried this?

My command line editor or DB2CLP abends and returns nothing

Paul Schulz

No luck for me either - I get the return parameters back but no output. I am pretty sure the CMD_EXEC should be = 1 if it actually worked (based on successful execution through IBM Data Studio):
db2 => call sysproc.admin_command_db2('-dis db(*) sp(*) restrict limit(*)', 34,TS,null,?,?,?,?,?,?,?,?)
CMD_EXEC: 0
IFCA_RET: 4
IFCA_RES: 15075332
XS_BYTES: 0
IFCA_GRES: 15075350
GXS_BYTES: 0
RETURN_CODE: 0
MSG: NULL

"ADMIN_COMMAND_DB2" RETURN_STATUS: 0

db2 =>

Paul Schulz

It turns out that null does not work for MEMBER (in my environment). I had to enter a correct Data Sharing Member name and it started to work properly - I get all the results back including CMD_EXEC = 1 (and all the rest of the return parms are = 0.

Robert Plata

The IBM Info Center documentation for this procedure states:
"If you specify processing-type, you must specify the command name in full, such as "-DISPLAY THREAD". You cannot abbreviate DB2 commands, such as "-DIS THD"." Troy uses a processing type of 'TS' in his example. I tried the example in my CLP, and it worked. But, I used: CALL SYSPROC.ADMIN_COMMAND_DB2('-DISPLAY DATABASE(*) SPACENAM(*) RESTRICT LIMIT(*)',100,'TS',NULL,?,?,?,?,?,?,?,?).

HTH. Bob

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Comments are moderated, and will not appear until the author has approved them.