[ale] Getting the next index of a table in mysql

Michael B. Trausch fd0man at gmail.com
Thu Jun 9 09:15:44 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Chris Fowler wrote:
>
> I've attached a perl program where I hacked out a way to get the next
> logical entry.  This program does not do the insert yet.
> 

Just note that if entries are added and deleted and so forth, that this
will not be accurate.  The program is selecting the highest current
serial number, when in fact, I could add 500 rows, and then delete them
all.  The max serial would then be (next_incremented_serial-501), and
then you'd be out of sync with the DB.  In addition, when you next
INSERT using a non-explicit ID count, you'll be out of sync.

	- Mike

- --
Michael B. Trausch                                     fd0man at gmail.com
Web: http://fd0man.theunixplace.com/        Jabber: mtrausch at jabber.com
Phone: +1-(678)-522-7934                  FAX (US Only): 1-866-806-4647
=======================================================================
  Do you have PGP or GPG?  Key at pgp.mit.edu, Please Encrypt E-Mail!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCqD59PXInbkqM7nwRA6caAJ0Qs0pX9X9raz660ftuYrg7GulNGACfX8MH
LkBCry3rMa+g/697ijbmr4Q=
=KkgU
-----END PGP SIGNATURE-----



More information about the Ale mailing list