You can override MySQL behaviour of generating a new value if you insert a 0
into an auton_increment field.
Quoting from the manual:
> NO_AUTO_VALUE_ON_ZERO affects handling of AUTO_INCREMENT columns.
> Normally, you generate the next sequence number for the column by inserting
> either NULL or
On 30/03/2006 12:31 p.m., Daniel Kasak wrote:
[EMAIL PROTECTED] wrote:
I suppose that would be alot easier than trying to bump the PK and
related FK values of the whole table by 1, just to give the first row
in the table the auto_increment value of 1?
Yes. That sounds messy.
What about be
[EMAIL PROTECTED] wrote:
Are you saying just change the row with the 0 value as the
PK, and change the FK's in the related tables to point to
the new value instaed of 0?
Yes.
If so, would this move the row logically to the end of the
table, if the 0 PK was replaced with the next auto_incr
l.com'"
> From: Daniel Kasak <[EMAIL PROTECTED]>
> Subject: Re: auto_increment and the value 0
>
> Stanton, Brian wrote:
> > I'm migrating a database from 4.0.12 on Solaris to 4.0.18-0 on Red
> > Hat
> > Linux. A few of the tables have a 0 (zero)
Stanton, Brian wrote:
I'm migrating a database from 4.0.12 on Solaris to 4.0.18-0 on Red Hat
Linux. A few of the tables have a 0 (zero) in the auto_increment primary
key column. However, when importing, the 0 in the insert is translated to
the next available auto_increment value thus causing a
I'm migrating a database from 4.0.12 on Solaris to 4.0.18-0 on Red Hat
Linux. A few of the tables have a 0 (zero) in the auto_increment primary
key column. However, when importing, the 0 in the insert is translated to
the next available auto_increment value thus causing a duplicate key
situation