umair Posted April 20, 2008 Share Posted April 20, 2008 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now