How dbUPLoader works

After you have created an upload configuration the tool creates 'java.sql.PreparedStatements' for each selected table (listed in the section SaveOrder). The structure of the prepared statements depends on the Datasource section:

  • From File

    In this case an ordinary placeholder (?) is set.

  • From Parameter

    The selected value is inserted into the statement. (First column of query. See parameters =>)

  • From sequence

    sequence_name.NEXTVAL or sequence_name.CURRVAL respectively will be inserted.

  • Const. value

    The data from the associated textfield is inserted.

  • Query

    If you have selected the 'Work with null value' radiobutton the subquery is inserted into the statement. The placeholders <<FileValX>> and <<ParamX>> are replaced as described above. If you select the 'DML-operation' option the UPLoader prepares a separate 'java.sql.PreparedStatement' for the subquery. This is executed and evaluated before the main insert statement is executed.

If you import data into DATE columns the data are always wrapped into the to_date function as shown below.


Example for genearated insert statement:

INSERT INTO mytable 
        (col1, col2, col3) 
        mysequence.NEXTVAL, // data from sequence
        ?, // placeholder for file data
        1, // selected data from parameter or a const value
        TO_DATE(?,'DD.MM.YYYY'), // placeholder for file data, when insert into a DATE column
        (SELECT prv_id FROM providers WHERE name = ?) // subquery