List:General Discussion« Previous MessageNext Message »
From:Simon Giddings Date:February 13 2007 9:39am
Subject:Re: Update failing with error 1062
View as plain text  
Hi Michael

Here is the table schema :
DROP TABLE IF EXISTS `clients`.`calendarentry`;
CREATE TABLE  `clients`.`calendarentry` (
  `idCalendarEntry` int(10) unsigned NOT NULL auto_increment,
  `Sujet` varchar(80) NOT NULL,
  `Debut` datetime NOT NULL,
  `Fin` datetime NOT NULL,
  `Notes` varchar(2048) default NULL,
  `Location` varchar(1023) default NULL,
  `ContactName` varchar(110) default NULL,
  `Structure` varchar(80) default NULL,
  `Telephone` varchar(30) default NULL,
  `ClientId` int(10) unsigned default NULL,
  `AllDayEvent` tinyint(4) NOT NULL,
  `IsMeeting` tinyint(4) NOT NULL,
  `HasReminder` tinyint(4) NOT NULL,
  `NextReminder` datetime default NULL,
  `ReminderMinutesBeforeStart` int(11) default '0',
  `ReminderIsMinutes` tinyint(4) default '0',
  `CEOid` int(10) unsigned default '0',
  `Repeats` tinyint(4) default '0',
  `RepeatPatternId` int(10) unsigned default '0',
  PRIMARY KEY  (`idCalendarEntry`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

As you can see, there are no other unique keys here.  In addition, there 
are no foreign keys which point here either.
Any ideas?

Simon

Michael Dykman wrote:
> Simon,
>
>   send in the schema for the table in question, that should show
> something.   The only condition I can think of off the top of my head
> which might do that is if you have another unique key in your
> structure and that is the one this error is complaining about.
>
> On 2/12/07, Simon Giddings <sgiddings@stripped> wrote:
>> Good morning,
>>
>> I issue an update statement containing a where clause on the primary
>> index, so as to update a single record. Howerver this is failing with
>> "Duplicate entry '6' for key 1" -
>> update clients.calendarentry set Subject = 'presentation' where
>> idCalendarEntry = 6;
>>
>> In the table, the field 'idCalendarEntry' is declared as :
>> `idCalendarEntry` int(10) unsigned NOT NULL auto_increment
>>
>> The server version of MySql I am using is 5.0.24
>> The client version of MySql I am using is 5.0.11
>>
>> Is anyone able to help?
>> Simon
>>
>> -- 
>> MySQL General Mailing List
>> For list archives: http://lists.mysql.com/mysql
>> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>>
>>
>
>
Thread
Update failing with error 1062Simon Giddings12 Feb
  • Re: Update failing with error 1062Devi12 Feb
  • Re: Update failing with error 1062Michael Dykman12 Feb
    • Re: Update failing with error 1062Simon Giddings13 Feb
Re: Update failing with error 1062Simon Giddings14 Feb