×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Retrieving a result set from a DB2 stored procedure

Retrieving a result set from a DB2 stored procedure

Retrieving a result set from a DB2 stored procedure

(OP)
I'm calling a DB2 stored procedure using a DBLOOKUP. The call is succeeding but its only returning the output parameters. How do I retrieve the result set?

DBLOOKUP("Call db2_proc(var1,var2,?,?);", ConnectString)
 

RE: Retrieving a result set from a DB2 stored procedure

don't think you can do it that way.  the stored proc needs to be an input card.

You could pass the vairable into a second map which will execute the proc and let that map complete your processing or try echoing the 2nd maps results back to the first map.

 

RE: Retrieving a result set from a DB2 stored procedure

(OP)
I tried with the stored proc call in an input card and it didn't return the result set, only the output parameters. The trace shows the call being executed and succeeding.
This is the database command on the input card.
-DBTYPE DB2 -SOURCE xxx -USER xxx -PASSWORD xxx  -STMT CALL DBL.SP2 ('55555','AAA','PPP', ,?,?,?,?)

I also tried in the output card using GET...same thing got output params no result set.

This is very weird since it works fine when returning multiple rows from a DB2 query.

I found this in the DB2 adapter help under limitations:
"Using stored procedures to access adapter commands and return values from stored functions is not supported."

So maybe getting DB2 stored procs with result sets just isnt't supported?

BTW, I'm using 8.2.0.4 interim fix 3

Thanks.

RE: Retrieving a result set from a DB2 stored procedure

add the stored procedure to the DBID, then in DBID define the select statment to call it like...

db2_proc(var1,var2,?,?)

Build your type tree and next your maps.  You NEED to pass your variables to a run map.  The runmap will use the results as input.

 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close