Index: trunk/FACT++/src/calcsource.cc
===================================================================
--- trunk/FACT++/src/calcsource.cc	(revision 19106)
+++ trunk/FACT++/src/calcsource.cc	(revision 19107)
@@ -30,4 +30,5 @@
         ("table.source",   var<string>("Source"),     "Name of the table where the sources are stored")
         ("table.position", var<string>("Position"),   "Name of the table where the calculated posiiton will be stored")
+        ("ignore-errors",  po_switch(),               "Adds the IGNORE keyword to the INSERT query (turns errors into warnings, ignores rows with errors)")
         ("force",          po_switch(),               "Force processing even if there is no database connection")
         ("drop",           po_switch(),               "Drop the table (implies create)")
@@ -104,5 +105,9 @@
         "The --create option is compatible with that. The --drop option is ignored.\n"
         "\n"
-        ""
+        "To avoid failure in case an entry does already exist, you can add the IGNORE "
+        "keyword to the INSERT query by --ignore-errors, which essentially ignores "
+        "all errors and turns them into warnings which are printed after the query "
+        "succeeded.\n"
+        "\n"
         "\n"
         "For debugging purposes several print options and options to avoid irreversible "
@@ -154,4 +159,6 @@
     const string   tab_source   = conf.Get<string>("table.source");
     const string   tab_position = conf.Get<string>("table.position");
+
+    const bool ignore_errors    = conf.Get<bool>("ignore-errors");
 
     const uint32_t file         = conf.Get<uint32_t>("file");
@@ -596,6 +603,8 @@
             cout << "Inserting data into table " << tab_position << "." << endl;
 
-        const string query2 =
-            "INSERT `"+tab_position+"` (FileId, EvtNumber, X, Y) VALUES\n"+
+        string query2 = "INSERT ";
+        if (ignore_errors)
+            query2 += "IGNORE ";
+        query2 += "`"+tab_position+"` (FileId, EvtNumber, X, Y) VALUES\n"+
             ins.str().substr(0, ins.str().size()-2)+
             "\n";
