Error calling DB2 stored procedure from SQL Server 2000

  • I am trying to execute the following to call a DB2 stored procedure from SQL Server 2000.

    DECLARE @ICVR_CLAIM_NBR VARCHAR(19)

    SET @ICVR_CLAIM_NBR= 'XXXXXXXXXXXXXXXXXXX'

    EXEC('call PPSPCOL.X2COVSEL (?)', @ICVR_CLAIM_NBR) AT [EXCEEDPP]

    and I get the following error

    Incorrect syntax near ','.

    It works in SQL Server 2008. Any ideas?

  • I'm not sure the EXECUTE...AT construct was available in SQL 2000.

    Concatenate the parameters and use OPENQUERY:

    DECLARE @ICVR_CLAIM_NBR VARCHAR(19)

    SET @ICVR_CLAIM_NBR= 'XXXXXXXXXXXXXXXXXXX'

    DECLARE @sql varchar(100)

    SET @sql = 'SELECT * FROM OPENQUERY(EXCEEDPP,''call PPSPCOL.X2COVSEL (''''' + @ICVR_CLAIM_NBR + ''''')'')'

    EXEC(@sql)

    -- Gianluca Sartori

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply