* 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:

<URL: http://www.mysql.com/doc/en/INSERT.html >

"If you specify the keyword IGNORE in an INSERT with many rows, any rows
that duplicate an existing PRIMARY or UNIQUE key in the table are ignored
and are not inserted."

--
Roger


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to