in reply to Perl DBI and Foreign Keys
This may not be practical, but: do not tell the DB to create an autoincrement id for you. Instead give each new table an id YOU create and guaranteed to be unique. That will create you extra headaches: checking if the id you generated already exists in db, unless the generating algorithm guarantees no collisions given different table data. A random number generator does not guarantee uniqueness. How about creating such an id from millisecond time of insertion plus an autoincrement in case there are more than 1 insertions per millisecond. That wont work if you have more than 1 user entering data in parallel, unless you create an "autoincrement server" which is overkill.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Perl DBI and Foreign Keys
by afoken (Chancellor) on Apr 09, 2019 at 19:07 UTC | |
by bliako (Abbot) on Apr 10, 2019 at 09:32 UTC | |
Re^2: Perl DBI and Foreign Keys
by Marshall (Canon) on Apr 08, 2019 at 11:19 UTC | |
by bliako (Abbot) on Apr 08, 2019 at 11:36 UTC | |
by Marshall (Canon) on Apr 08, 2019 at 12:29 UTC | |
by soonix (Chancellor) on Apr 08, 2019 at 14:32 UTC | |
by dsheroh (Monsignor) on Apr 09, 2019 at 07:27 UTC |