INSERT IGNORE has the following distinction from normal INSERT in MYSQL:

>    - 
>    
>    If you use the IGNORE keyword, errors that occur while executing the 
>    INSERT <http://dev.mysql.com/doc/refman/5.5/en/insert.html> statement 
>    are treated as warnings instead. For example, without IGNORE, a row 
>    that duplicates an existing UNIQUE index or PRIMARY KEY value in the 
>    table causes a duplicate-key error and the statement is aborted. With 
>    IGNORE, the row still is not inserted, but no error is issued. 
>    
>     IGNORE has a similar effect on inserts into partitioned tables where 
>    no partition matching a given value is found. Without IGNORE, such 
>    INSERT <http://dev.mysql.com/doc/refman/5.5/en/insert.html> statements 
>    are aborted with an error; however, when INSERT 
> IGNORE<http://dev.mysql.com/doc/refman/5.5/en/insert.html>is used, the insert 
> operation fails silently for the row containing the 
>    unmatched value, but any rows that are matched are inserted. For an 
>    example, see Section 18.2.2, “LIST 
> Partitioning”<http://dev.mysql.com/doc/refman/5.5/en/partitioning-list.html>. 
>    
>    
>    Data conversions that would trigger errors abort the statement if 
>    IGNORE is not specified. With IGNORE, invalid values are adjusted to 
>    the closest values and inserted; warnings are produced but the statement 
>    does not abort. You can determine with the 
> mysql_info()<http://dev.mysql.com/doc/refman/5.5/en/mysql-info.html>C API 
> function how many rows were actually inserted into the table. 
>    
>
So, IGNORE causes INSERT not to raise any error on any error :) Actually, I 
don't really like this behavior since it swallows errors. Warnings are 
usually not properly handled by error-handling code in most APIs.

вторник, 10 апреля 2012 г., 13:36:37 UTC+4 пользователь name256 написал:
>
> Hi,
>
> I am a newbie to JOOQ. I was wondering whether someone has been able to 
> implement an implementation of insert ignore for the MYSQLFactory. Kindly 
> let me know. I would't mind a guide to doing this myself as well as it will 
> give me a better insight into JOOQ.
>
> Regards.
>
> Abel
>

Reply via email to