Based on a Document number, I need to call two different stored procedures.. Both the input and output layout are same for both stored procedure.. some documents go to table 'A' and stored procedure 'Get Table A', while other documents go to table 'B' and stored procedure 'Get Table b'..
Is this achievable through Mapping instead of receiver determination? If so how do we achieve it? As far as I can see two different Message types are need to invoke two different stored procedure... So I am not sure how I can achieve this..
Bhavesh Kantilal replied
<i>As far as I can see two different Message types are need to invoke two different stored procedure</i>
If the stored Procedure expects different input and output parameters , then different Message Types are needed. If the stored procedure has same input and output parameters, then a single message type can do the trick.
<i>Both the input and output layout are same for both stored procedure..</i>
<b>So, I think one message type would be enough.</b>
In your mapping, on the basis of your Document Number, you can create the value for the Stored Procedure and that would do the trick.
<storedProcedureName action= EXECUTE>
<param1 [isInput=true] [isOutput=true] type=SQLDatatype>val1</param1>
On the basis on your input, you can map the value for
<b>realStoredProcedureeName</b> to call the corresponding stored procedure. Just make sure, the occurence of Sttement is 0 to undbounded when defining your destination datatype.