DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Exploring Data Redaction Enhancements in Oracle Database 23ai
  • Fixing Common Oracle Database Problems
  • A Practical Pipeline for Identifying Sensitive Columns Before Test Data Masking
  • Parquet vs Lance: How Storage Layout Changes the Read Path

Trending

  • Building a Grounded Search Agent With Foundry, Azure AI Search, and Cosmos DB, Containerized With Docker and Observed With Grafana
  • When Production Stops Moving: Running Claude Code Across a Distributed Enterprise Integration Team
  • Introduction to Error Prone: How to Catch Bugs at Compile Time
  • Microsoft Fabric Throttling: Diagnose Before You Scale

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Data Engineering
  3. Databases
  4. Mule: How to Upsert Data in the Oracle Database

Mule: How to Upsert Data in the Oracle Database

See how to upsert data in the Oracle Database.

By 
Muralidhar Gumma
·
Sep. 17, 19 · Code Snippet
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
13.2K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

Image title

How do we upsert data in Oracle?

Most of the time, we get into a situation where we need to perform an upsert operation (update the record if else Insert exists). We do not have a separate database operation to achieve this upsert functionality. Below, you will see this upsert functionality achieved using the Merge function in the database.

GOAL: You want to perform Bulk Updates in a Mule 4 Application.

NOTE: As a requirement, you will need to use the DB Connector 1.5.1 version or above.

SQL Merge is an Update function, so you will need to use the Update Connector.

See the code below:

<db:bulk-update doc:name="Bulk update" doc:id="ab77f2ce-8185-40ee-9704-99d5e4c31a43" config-ref="Oracle">
<db:sql >MERGE INTO destination USING origin ON (Id = :Id)
WHEN MATCHED
THEN UPDATE SET Id = :Id,
Price =
:Price
WHEN NOT MATCHED THEN INSERT (Id, Price) VALUES (
:Id, :Price)</db:sql>
<db:bulk-input-parameters ><![CDATA[#[[{'Id': 2, 'Price': 200m= }]]]]></db:bulk-input-parameters>
</db:bulk-update>


Further Reading

MuleSoft, Salesforce UPSERT

External Data Operations on Salesforce Analytics Using Mulesoft Salesforce Analytics Connector Part 1

Database Oracle Database Data (computing)

Opinions expressed by DZone contributors are their own.

Related

  • Exploring Data Redaction Enhancements in Oracle Database 23ai
  • Fixing Common Oracle Database Problems
  • A Practical Pipeline for Identifying Sensitive Columns Before Test Data Masking
  • Parquet vs Lance: How Storage Layout Changes the Read Path

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook