Hi, new here, and new to db2. I'm pretty much a lightweight on DB anyway, but we've been using Informix for the last 13 years and are attempting a migration to DB2.
I've rewritten all my stored procedures and views for DB2 and they seem to all work great, so long as I'm executing them on the host server.
However, what I really need is to execute these from SQL server via a linked server. The SQL server admin has installed a OLE DB linked server, as he had for the Informix server, and it works great for SELECT queries, but not for stored procedures.
For example, this works fine:
Code:
SELECT * FROM OPENQUERY (DB2_TEST, 'SELECT * FROM Lawson.CuCodes;')
I can execute the procedure from the command prompt on the DB2 server no problem:
Code:
$ db2 "call Lawson.NextCheck('19' , ?)"
Value of output parameters
--------------------------
Parameter Name : CHECKNBR
Parameter Value : 15835865
Return Status = 0
However, if I attempt to call it from the openquery it returns and error:
Code:
SELECT * FROM OPENQUERY (DB2_TEST, 'CALL Lawson.NextCheck ( ''19'' , ? )')
Msg 7357, Level 16, State 2, Line 1
Cannot process the object "CALL Lawson.NextCheck ( '19' , ? )". The OLE DB provider "IBMDADB2.DB2COPY1" for linked server "DB2_TEST" indicates that either the object has no columns or the current user does not have permissions on that object.
I've tried testing the OLE DB connection using the DB2 owner's permissions, but that didn't help.
Is this an easy fix?
64 bit DB2 v9.1.0.7 fix pack 7
SQLServer 2005 sp3
IBM OLE DB driver v9.7