I have a linked server pointing to DB2 on AS400. I am trying to call a stored proc on the AS400 from SQL Server 2008. I first tried:
I get the error message: The OLE DB provider "IBMDA400" for linked server "ADM_AS400_LPAR" indicates that either the object has no columns or the current user does not have permissions on that object.
It is definately not a permissions issue.
I then tried the 4 part syntax.
Error message: OLE DB provider "IBMDA400" for linked server "ADM_AS400_LPAR" returned message "SQL0104: Token { was not valid... A syntax error was detected at token {.
I ran a trace on the AS400 to see exactly what the linked server passed to it. It passed the following:
Well, that is certainly not valid DB2 syntax, but I have no idea why the linked server generated that syntax. Does anyone have any suggestions?
Code:
select * from openquery ( ADM_AS400_LPAR, 'CALL XGGNDTAADM.EFILE_GET_QUICK_SEARCH (''C007984A'')')
It is definately not a permissions issue.
I then tried the 4 part syntax.
Code:
EXEC ADM_AS400_LPAR.EMJ_TST.XGGNDTAADM.EFILE_GET_QUICK_SEARCH 'C007984A'
I ran a trace on the AS400 to see exactly what the linked server passed to it. It passed the following:
Code:
{?=call "EMJ_TST"."XGGNDTAADM"."EFILE_GET_QUICK_SEARCH";1(?)}