Re: insert failure, move on question

2003-10-13 Thread Roger Baklund
* dan orlic > How, in a sql script, do I gracefully fail an insert? For example, I > insert a record that has an primary key of 1, and it already exists. I > want my script to > Move down to the next record, not fail out. Thanks! See the IGNORE option of the INSERT statement: http://www.mysql.

RE: insert failure, move on question

2003-10-13 Thread Dathan Vance Pattishall
# if using perl and DBI pseudo code die $ERROR if ($dbh->errstr() && $dbh->errstr() !~ /Duplicate Error/); If $dbh->errstr() =~ /Duplicate Error/ do your specified logic Else Return inserted id - Dathan Vance Pattishall   - Sr. Programmer and mySQL DBA for FriendFinder Inc.   - http://fr

Re: insert failure, move on question

2003-10-13 Thread Paul DuBois
At 13:44 -0500 10/13/03, dan orlic wrote: How, in a sql script, do I gracefully fail an insert? For example, I insert a record that has an primary key of 1, and it already exists. I want my script to Move down to the next record, not fail out. Thanks! If you're executing the script with the mysq