| Author |
java.sql.SQLException: Invalid argument value: Duplicate entry '3' for key 1
|
Satyajeet Kadam
Ranch Hand
Joined: Oct 19, 2006
Posts: 202
|
posted

0
|
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]
|
 |
Scott Selikoff
Saloon Keeper
Joined: Oct 23, 2005
Posts: 3652
|
posted

0
|
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.
|
My Blog: Down Home Country Coding with Scott Selikoff
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26182
|
posted

0
|
|
Please continue conversation in your other thread.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
 |
|
|
subject: java.sql.SQLException: Invalid argument value: Duplicate entry '3' for key 1
|
|
|