in reply to Perl DBI and Foreign Keys
If you really don't think you can accept working with last_insert_id, then there's also the option of doing your insert, then SELECT id FROM Participants WHERE Url = $the_url_i_just_inserted, since you say the url is unique, but it seems a bit wasteful to do that extra query when last_insert_id is sitting right there, just waiting to be used for this exact purpose.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Perl DBI and Foreign Keys
by Marshall (Canon) on Apr 08, 2019 at 10:05 UTC | |
by hdb (Monsignor) on Apr 08, 2019 at 12:30 UTC | |
by Marshall (Canon) on Apr 08, 2019 at 12:45 UTC | |
by soonix (Chancellor) on Apr 08, 2019 at 12:55 UTC | |
by afoken (Chancellor) on Apr 09, 2019 at 23:24 UTC | |
by dsheroh (Monsignor) on Apr 09, 2019 at 07:29 UTC | |
by afoken (Chancellor) on Apr 09, 2019 at 18:37 UTC |