1.  The auto_increment will not occur on failure.  Try it yourself to
verify; I did.

2.  When you delete a row, you DO NOT WANT the auto-increment to re-number.
You SHOULD have gaps.  Why?
Because if the auto_incremented field is a primary key, and there are other
tables who fields refer to that field, you WANT those links to remain valid.
Otherwise, the fields in the other tables will NO LONGER point-to the
records they originally pointed to.

-----Original Message-----
From: Chetan Lavti [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 25, 2002 1:15 PM
To: [EMAIL PROTECTED]
Subject: auto increment problem


hi,
I creating a table where I am using one field as Auto Increment. I want
to know two things or rather I want to do to thinks for the same column

1. When I am inserting the values and the Query fails, the increment
should not took place and 
2. When I delete a particular row from the table there should not be any
gap in the auto increment sequence.

Is it possible..??

I am not much enthusiastic about the second one because I don't think
that I will use it.

Anyone who can help me out for this.??

Thanks and regards,
Cretan Latvia
   




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to