Changeset 19107
- Timestamp:
- 07/31/18 14:53:03 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/calcsource.cc
r19106 r19107 30 30 ("table.source", var<string>("Source"), "Name of the table where the sources are stored") 31 31 ("table.position", var<string>("Position"), "Name of the table where the calculated posiiton will be stored") 32 ("ignore-errors", po_switch(), "Adds the IGNORE keyword to the INSERT query (turns errors into warnings, ignores rows with errors)") 32 33 ("force", po_switch(), "Force processing even if there is no database connection") 33 34 ("drop", po_switch(), "Drop the table (implies create)") … … 104 105 "The --create option is compatible with that. The --drop option is ignored.\n" 105 106 "\n" 106 "" 107 "To avoid failure in case an entry does already exist, you can add the IGNORE " 108 "keyword to the INSERT query by --ignore-errors, which essentially ignores " 109 "all errors and turns them into warnings which are printed after the query " 110 "succeeded.\n" 111 "\n" 107 112 "\n" 108 113 "For debugging purposes several print options and options to avoid irreversible " … … 154 159 const string tab_source = conf.Get<string>("table.source"); 155 160 const string tab_position = conf.Get<string>("table.position"); 161 162 const bool ignore_errors = conf.Get<bool>("ignore-errors"); 156 163 157 164 const uint32_t file = conf.Get<uint32_t>("file"); … … 596 603 cout << "Inserting data into table " << tab_position << "." << endl; 597 604 598 const string query2 = 599 "INSERT `"+tab_position+"` (FileId, EvtNumber, X, Y) VALUES\n"+ 605 string query2 = "INSERT "; 606 if (ignore_errors) 607 query2 += "IGNORE "; 608 query2 += "`"+tab_position+"` (FileId, EvtNumber, X, Y) VALUES\n"+ 600 609 ins.str().substr(0, ins.str().size()-2)+ 601 610 "\n";
Note:
See TracChangeset
for help on using the changeset viewer.