IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
 View Only
Expand all | Collapse all

Calling SQL Server Stored Procedure from ITX

Archive User

Archive UserWed January 17, 2018 01:26 AM

Archive User

Archive UserTue January 23, 2018 01:07 PM

  • 1.  Calling SQL Server Stored Procedure from ITX

    Posted Wed January 17, 2018 01:26 AM

    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


  • 2.  Re: Calling SQL Server Stored Procedure from ITX

    Posted Tue January 23, 2018 01:07 PM

    Originally posted by: carao2020


    Hi All,

     

    Could someone please verify this issue and advise on the resolution. Thanks in advance.


    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender