Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.sql.SQLException: Invalid argument value: Duplicate entry '3' for key 1

 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi, i am getting following error
I am using mysql database


<code>
java.sql.SQLException: Invalid argument value: Duplicate entry '3' for key 1
</code>







ts_user CREATE TABLE `ts_user` (
`user_id` int(11) NOT NULL auto_increment,
`ref_company_id` int(11) default NULL,
`email` varchar(50) default NULL,
`password` varchar(10) default NULL,
`name` varchar(25) default NULL,
PRIMARY KEY (`user_id`),
KEY `ref_company_id` (`ref_company_id`),
FOREIGN KEY (`ref_company_id`) REFERENCES `ts_company` (`company_id`)
) TYPE=InnoDB


[/CODE]
 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not duplicate post.

To answer your question for both posts as previously stated, DO NOT USE COUNT(*) FOR AUTO_INCREMENT, your record count is out of sync with your data.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please continue conversation in your other thread.
 
Anderson gave himself the promotion. So I gave myself this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic