Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > DBD::mysql::st execute failed: Duplicate entry '127' for key 1

Reply
Thread Tools

DBD::mysql::st execute failed: Duplicate entry '127' for key 1

 
 
mike
Guest
Posts: n/a
 
      04-22-2005
My autoincrement is stuck on entry 127.

My script tried to insert a new record and I got this entry

"DBD::mysql::st execute failed: Duplicate entry '127' for key 1 "

Yes id 127 aready exists. When 127 was created the pointer should have
moved to 128, but it didn't.

How do I change the autoincrement pointer in MySQL?

Mike

 
Reply With Quote
 
 
 
 
xhoster@gmail.com
Guest
Posts: n/a
 
      04-22-2005
"mike" <(E-Mail Removed)> wrote:
> My autoincrement is stuck on entry 127.
>
> My script tried to insert a new record and I got this entry
>
> "DBD::mysql::st execute failed: Duplicate entry '127' for key 1 "


Do you have a Perl question?

>
> Yes id 127 aready exists. When 127 was created the pointer should have
> moved to 128, but it didn't.


Are you explicitly setting the field value to 127 but expecting MySQL to
override it with 128 anyway? If so, don't do that.

> How do I change the autoincrement pointer in MySQL?


I don't know, but it would help if you would:
1) Include the actual thing that is causing the error.
2) Post it to the right group.


Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
 
Reply With Quote
 
 
 
 
mike
Guest
Posts: n/a
 
      04-22-2005
Yes I posted it in: perl.dbi.users, but I didn't get a response there.

My auto_incrementer is not working. I manually deleted record 127 and
did a re-insert, it got 127 like it should, but did not set the pointer
to 128.

 
Reply With Quote
 
J. Gleixner
Guest
Posts: n/a
 
      04-22-2005
mike wrote:
> Yes I posted it in: perl.dbi.users, but I didn't get a response there.
>
> My auto_incrementer is not working. I manually deleted record 127 and
> did a re-insert, it got 127 like it should, but did not set the pointer
> to 128.


Your question is about MySQL, not perl.

I'd guess that your column is a 'tinyint' and it needs to be bigger.
 
Reply With Quote
 
mike
Guest
Posts: n/a
 
      04-22-2005
Again. I got no response there ....

Yes it is defined like:

post_id tinyint not null primary key auto_increment

How would the field being tinyint allow 127, but not 128?

 
Reply With Quote
 
xhoster@gmail.com
Guest
Posts: n/a
 
      04-22-2005
"mike" <(E-Mail Removed)> wrote:
> Again. I got no response there ....
>
> Yes it is defined like:
>
> post_id tinyint not null primary key auto_increment
>
> How would the field being tinyint allow 127, but not 128?


Because by definition, tinyint allows 127 but not 128. That is why it is
tiny.

http://dev.mysql.com/doc/mysql/en/numeric-types.html

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      04-22-2005
mike <(E-Mail Removed)> wrote:

> Again.



What again?

Please quote some context in followups like everyone else does!


> I got no response there ....



That does not magically make it into a Perl question.

Database questions are off-topic in non-database newsgroups.

Please do not make any more off-topic posts here.


> Yes it is defined like:
>
> post_id tinyint not null primary key auto_increment
>
> How would the field being tinyint allow 127, but not 128?



Ask Perl questions in the Perl newsgroup.

Ask database questions in a database newsgroup.


--
Tad McClellan SGML consulting
http://www.velocityreviews.com/forums/(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate entry while reading from ifstream into vector steve.cpp@gmail.com C++ 2 12-28-2008 01:33 PM
Stumped! duplicate entry won't go away! richard HTML 6 08-03-2008 02:23 PM
mysqldb duplicate entry error handling baur79 Python 6 02-02-2007 01:17 PM
Prevent duplicate entry to MS Access database mmazid@googlemail.com ASP .Net 0 02-08-2006 08:40 PM
preventing duplicate data entry on RELOAD Darrel ASP .Net 5 12-06-2004 04:42 PM



Advertisments