Changes between Version 6 and Version 7 of DatabaseBasedAnalysis/table2sql


Ignore:
Timestamp:
08/10/18 19:30:59 (6 years ago)
Author:
tbretz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DatabaseBasedAnalysis/table2sql

    v6 v7  
    128128== Ignore duplicate entries ==
    129129
    130 Usually, the `INSERT` query would fail if another row with the same primary key exists already.  This can be avoided adding 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.
     130Usually, the `INSERT` query would fail if another row with the same primary key exists already.  This can be avoided adding 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 succeede.
    131131
    132132== Update duplicate entries ==
     
    139139
    140140The `--duplicate` resource can be specified more than once to add more expressions to the assignment_list. For more details, see the MySQL manual.
     141
     142== Insert constant values ==
     143
     144Sometimes it might be necessary to insert a constant value for each file which is processed (for example a file ID which is not part of the stored data). This can be achieved by the `--fixed.COLUMN=VALUE` directive where '''COLUMN''' the column name and '''VALUE''' is the value filled into the column. As default, the column is create as '''INT UNSIGNED''' but this can be overwritten as usual with the `--sql-type` directive.
     145
     146A special case is when '''VALUE''' has the form `/regex/[N]/`. In this case the given regular expressen is searched with boost::regex_search in the given filename. If '''N''' is specified it is the number of the subsequent match. For example, if
     147{{{
     148--const.mycolumn=/_([0-9]+)_/1/
     149}}}
     150would be matched with ''file_12345_name.ext'', the first sub-sequence (0) would be '_12345_' and the second sub-sequence (1) would be '12345'. Therefore, '12345' would be inserted. Because it is not always apparent which sub-sequence gets which number, a verbosity level of 3 can be used to print the match result.
    141151
    142152== Debugging ==