MySQL Forums
Forum List  »  General

Can some please help me with a duplicate key error
Posted by: mike browne
Date: May 16, 2013 07:03AM


I have been trying to solve this problem for a long time and have not found a solution, so could someone please assist me.

I am getting this error:

[MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt]Duplicate entry '' for key 2

Now as far as I know I only have one index on the table and it is the primary key which is auto-increment. So what is this error really telling me, what is it referring to when it says "For Key 2", I cannot figure out what key2 is.

Also, it shows as a '' which to me looks like a null. However I have every field filled in with something on the insert clause.

Insert clause is:

INSERT INTO ASSETSCHEDULE (AssetID,DateReserved,DateReservedString,CreatDate,CreatDateString,CreatTime,CreatTimeString,TimeReserved,TimeReservedString,ReserveLength,LastRecordedTime,LastRecordedTimeString,PatronBarcode,PatronFirstName,PatronLastName,PatronType,ReserveType,BookingCode,RecordDeleted,BranchLocated,ZoneLocated) VALUES('Table7',41409,'5/15/2013',41409,'5/15/2013',0.59880594907,'2:22:16 PM',0.59791666667,'2:21:00 PM',60,0.59791666667,'2:21:00 PM','Temp Schedule ',' ',' ',' ',1,'T8DJ9B350E7OO23',2,'Main Room',0)

I am at a loss for why this would error off with the above error message. So can someone please assist me, or tell me what to look for.

Thanks for any information


Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.