Subject Re: [firebird-support] Insert statement
Author Milan Babuskov
munster77054 wrote:
> Because of one of my domains, I've become FAMILIAR with MySQL. Within this, it has an "INSERT IGNORE" in addition to the standard "INSERT" statement. This command instructs the database engine to attempt the insert, and if it fails, just to continue on to the next INSERT statement. This works well if the record is a duplicate based on the Primary Key, for instance.
>
> I've looked and looked, but can't find an equivalent statement for FIREBIRD (2.1.x)

You can use EXECUTE BLOCK and ignore the duplicate key error (-803):

---------------------------------
execute block as begin
INSERT INTO ... VALUES (...);
when SQLCODE -803 do exit; end
---------------------------------


--
Milan Babuskov

==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================