Wednesday, March 7, 2012

call db2 stored procedure

Are there any examples of aclling a db2 stored procedure with input and output parameters from sql 2000 tsql? Thanks

use linked server..

example:

EXEC sp_addlinkedserver

@.server='DB2',

@.srvproduct='Microsoft OLE DB Provider for DB2',

@.catalog='DB2',

@.provider='DB2OLEDB',

@.provstr='Initial Catalog=PUBS;Data Source=DB2;HostCCSID=1252;Network Address=XYZ;Network Port=50000;Package Collection=admin;Default Schema=admin;'

EXEC sp_addlinkedsrvlogin 'DB2', 'false', NULL, 'DB2User', 'DB2Password'

Then use OPENQUERY function to call your target DB2 objects..See more on online book about Linked Server.|||Thanks for the update. I see examples of using openquery with db2 select statements but couldn't find any that called a stored procedure with input and output procedures. Is there another function that should be used? Thanks|||Are there any examples of calling a db2 stored procedure with input and output parameters? Should I use the {call format. are there any examples for that? Thanks

No comments:

Post a Comment