Jump to content
Changes to the Jaspersoft community edition download ×

How to maintain a primary key state during Update


umair

Recommended Posts

Hello!

I have a situation in which i read the record of the country from a file and load them into MYSQL DB.

The loading works just fine.

The primary key 'country_id' has 'Auto_Increment' set to it which ensures that this column is automatically updated every time a new field is read from the file and loaded into the table.

 

Now the problem is, this scenario works fine for the first run.

Now, if i run the job second time, this would insert the same country data into the table with new primary key values.

Thus resulting in duplication of records.

 

What i need is that if the record needs to be updated, then the primary key should remain constant instead of incrementing.

 

I tried using Update or Insert / Insert or Update but same results.

 

Any workaround against this problem ?

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...