Bulk Update Operation In DB

 

In this tutorial we will demonstrate how to use Bulk Update Operation In DB ,Using Bulk Update operation we can update the multiple database rows at a time,Bulk operations allow you to run a single query using a set of parameters values.

Advantage of Bulk Operation:

  • The query is parsed only once.
  • Only one database connection is required since a single statement is executed.
  • Network overhead is minimized.
  • RDBMS can execute the bulk operation atomically

Create project in anypoint studio and configure the listener to trigger the flow

Sample JSON Input:


{
"CUSTOMER_ID":1,
"CUSTOMER_NAME":"TEST11",
"ADDRESS1":"Flat 101",
"ADDRESS2":"Viman Nagar 1",
"POSTALCODE":"201018",
"CITY":"PUNE"
},{
"CUSTOMER_ID":2,
"CUSTOMER_NAME":"TEST22",
"ADDRESS1":"Flat 102",
"ADDRESS2":"Viman Nagar 2",
"POSTALCODE":"201019",
"CITY":"PUNE"
},{
"CUSTOMER_ID":3,
"CUSTOMER_NAME":"TEST33",
"ADDRESS1":"Flat 103",
"ADDRESS2":"Viman Nagar 3",
"POSTALCODE":"201018",
"CITY":"PUNE"
},{
"CUSTOMER_ID":4,
"CUSTOMER_NAME":"TEST44",
"ADDRESS1":"Flat 104",
"ADDRESS2":"Viman Nagar 4",
"POSTALCODE":"201019",
"CITY":"PUNE"
}

Create Sample Payload:

Bulk Update Operation In DB

 

Drag and drop Bulk Update from mule palette

Complete the connector configuration

 

Configure the bulk update operation, you can pass the payload as a input parameters and sql query as shown below

Bulk Update Operation In DB

 

Deploy and test the application

  
Thank you for taking out time to read the above post. Hope you found it useful. In case of any questions, feel free to comment below. Also, if you are keen on knowing about a specific topic, happy to explore your recommendations as well.
 
For any latest updates or posts on our website, you can follow us on LinkedIn. Look forward to connecting with you there.


Share this:
Subscribe
Notify of
guest
3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Ram
Ram
2 years ago

How to check bulk insert/update is succeeded or not. What is the acknowledgement we can get it from bulk insert/update. Single Update DB will show you payload.affectedRows details but bulk how we can check ack.

Afreen khanam
Afreen khanam
2 years ago

What’s the limit for data for bulk update?

Rechardo
Rechardo
1 year ago
Reply to  Afreen khanam

Anyone has any idea on limit?