Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8765377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:15:52+00:00 2026-06-13T16:15:52+00:00

I have a table that needs to merge from same table in another database.

  • 0

I have a table that needs to merge from same table in another database.

Condition is one of the column in composite primary key is generated by sequence and may differ in another database.

How can we sync remaining columns in this situation?

Ex.
DB1:
Table: SRE_SERVICE_OPTION
Columns:(OPTION_SET_ID, OPTION_NAME, OPTION_VALUE, VALUE_ORDER)

DB2:
Table: SRE_SERVICE_OPTION
Columns:(OPTION_SET_ID, OPTION_NAME, OPTION_VALUE, VALUE_ORDER)

Primary key:
OPTION_SET_ID, OPTION_NAME, VALUE_ORDER

How should I write merge statement?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:15:53+00:00Added an answer on June 13, 2026 at 4:15 pm

    You’ve made the classic error in a distributed database. Simply put, by using two separate sequences you have an inconsistent primary key across the tables. You will only be able to use MERGE if your tables are both separately unique on OPTION_NAME, OPTION_VALUE and VALUE_ORDER.

    Your only other hope is that your tables do not contain any duplicated information between them. If so you can simply insert from one into the other.

    Otherwise, you are, I’m afraid out of luck. I would re-design your database so that it’s impossible to send duplicated information into two different tables with separate, inconsistent, surrogate keys.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to merge data from one table to another. The data is delivered
I have a table row that needs to be hidden when the anchor with
I have a large database table that I need to display on a Windows
I have a table of data that I need to dynamically add a column
I have a database two tables and a linking table that I need a
So, basically, I have a MySQL table called 'topics' and another one called 'replies',
I have two datasets each with one data table pulled from different sources and
I need to consolidate 20 databases that have the same structure into 1 database.
I have a table that stores formulary drug information and needs to be updated
Let's say we have a database with a table that has many other associated

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.