Originally posted by: carao2020
Hi All,
Could someone help me in writing mapping rule to call SQL Server 2012 Stored Procedure with OUTPUT parameters. I am using ODBC adapter to connect to SQL Server DB. I am not able to call the Stored Procedure using Database independent syntax using CALL to call the SQL Server stored Procedure. I am able to execute the stored procedure without output parameters using EXEC syntax. If I output parameters, SQL Server is throwing error saying that Stored Procedure expects parameter "@y".
Stored Procedure:-
CREATE PROCEDURE [dbo].[test_ReturnValue] (@x VARCHAR(max), @y VARCHAR(max) output)
AS BEGIN
SET @y='Returning: '+@x;
END
Calling Rule:-
=VALID(DBLOOKUP( "EXEC [%DBNAME%].[dbo].[test_ReturnValue] @x='This is Test Value' , @y=?", "-TE+ %debugpath%/TEST.dbl -MDQ %mdqpath%CNO.mdq -DBNAME %DBNAME%"),FAIL("E01.Error executing Stored Procedure [%DBNAME%].[dbo].[insert_BODDetail];" + LASTERRORCODE() + LASTERRORMSG()))
Error:-
<20120-30380-01/18/18 01:13:45>: Error in SQLExecDirect
Message: [Microsoft][ODBC Driver 13 for SQL Server]COUNT field incorrect or syntax error
SQL State: 07001
Request your urgent help on this issue.
Thanks.
#IBMSterlingTransformationExtender#DataExchange#IBM-Websphere-Transformation-Extender