Home United States USA — software Send a Table-Valued Parameter to a MS SQL Stored Procedure in Mule...

Send a Table-Valued Parameter to a MS SQL Stored Procedure in Mule 4

4514
0
SHARE

One interesting variation of sending data via table-valued parameter (TVP) is not so commonly used. Let’s talk about how to get started.
Join the DZone community and get the full member experience. Most of us have called a stored procedure in Mule to pass data to or receive data from database tables. However, one interesting variation of sending data via table-valued parameter (TVP) is not so commonly used. This article will show you how to send data in a TVP format to an MS SQL table via a stored procedure in Mule 4. Before we proceed with the actual Mule development, let’s first understand what a table-valued parameter is. As the name suggests, it is a parameter where data is sent in the form of a table, comprised of columns and rows. Within the database, table-valued parameters are declared by using user-defined table types. The main purpose of a TVP is to pass multiple values for a record, e.g. Multiple contact number values for a user record merged in the record itself. The benefit is that it associates the values, maintains the sequence, and reduces code complexity in the stored procedure. Before you can start developing the logic for generating a TVP, you will need to import the Java module in your Mule Project. This is required as we will be invoking methods in a Java class. If you have already imported it or are familiar with the process of importing it, you can skip the next section.

Continue reading...