Call a iSeries stored proc from a SQL server 2005 stored proc

9690 pts.
Tags:
AS/400
iSeries AS/400
Linked Server
Stored Procedure
Ok I'm missing something. I've tried entering a few examples I have found in forums but can't get past a syntax error I cannot find. I'm using a linked server as well. Here is the code for the SP.

Any pointers would be great!

USE [MyDB]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[GetTaxes]

@cust Varchar(6),
@div Varchar(2),
@ESWH Varchar (2),
@EGRS DECIMAL (15, 4),
@EFRT DECIMAL (15, 4),
@ECITY Varchar (18),
@EST Varchar (2),
@EZIP Varchar (5),
@EJOB Varchar (10),
@ETAX DECIMAL (15, 4) output,
@ERATE DECIMAL (5, 5) output

AS
BEGIN
SET NOCOUNT ON

EXEC ('CALL QGPL.UITAXPR (?,?,?,?,?,?,?,?,?,?,?)' ,
@cust, @div, @ESWH, @EGRS, @EFRT, @ECITY, @EST,
@EZIP, @EJOB, @ETAX OUTPUT, @ERATE OUTPUT)
at MYLINKED_SERVER

select @ETAX, @ERATE
END 
The error I'm getting is Message 170, Level 15, State 1, Procedure GetTaxes, Line 21 Line 21: Incorrect syntax near ','.

Software/Hardware used:
SQL Server 2005, i-Series

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    It doesn't seem to be closely related to "AS400 stored proc" except that it's the target. The issue seems totally contained within the SQL Server SP statement syntax. I can't see anything in the posted statement that looks wrong, though. And I don't have SQL Server available. Updating 'Tags' on the question might help. -- Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following