Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   DBD::mysql::st execute failed: Duplicate entry '127' for key 1 (http://www.velocityreviews.com/forums/t891966-dbd-mysql-st-execute-failed-duplicate-entry-127-for-key-1-a.html)

mike 04-22-2005 01:20 PM

DBD::mysql::st execute failed: Duplicate entry '127' for key 1
 
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


xhoster@gmail.com 04-22-2005 02:38 PM

Re: DBD::mysql::st execute failed: Duplicate entry '127' for key 1
 
"mike" <hillmw@charter.net> 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

mike 04-22-2005 03:06 PM

Re: DBD::mysql::st execute failed: Duplicate entry '127' for key 1
 
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.


J. Gleixner 04-22-2005 03:38 PM

Re: DBD::mysql::st execute failed: Duplicate entry '127' for key1
 
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.

mike 04-22-2005 04:24 PM

Re: DBD::mysql::st execute failed: Duplicate entry '127' for key 1
 
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?


xhoster@gmail.com 04-22-2005 04:33 PM

Re: DBD::mysql::st execute failed: Duplicate entry '127' for key 1
 
"mike" <hillmw@charter.net> 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

Tad McClellan 04-22-2005 08:36 PM

Re: DBD::mysql::st execute failed: Duplicate entry '127' for key 1
 
mike <hillmw@charter.net> 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
tadmc@augustmail.com Perl programming
Fort Worth, Texas


All times are GMT. The time now is 08:48 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.