Advanced Database Target

The Advanced Database Target service provides the ability to specify multiple tables of a database. These are the target tables for which you can fetch the data from the source location by creating a source service. On execution of the process flow, the service maps the layout of the fetched data to the layout of the target data. Moreover, depending on how you want to process the error records, the service will move the data records to these target tables.

Prerequisites

Ensure that you have created Database Info and Advanced Database Layout services.


Steps to create an Advanced Database Target:

  1. Click Configure > TARGETS > Advanced Database Target.
  2. Click Create Advanced Database Target.
  3. Enter the name and description of the new Database Target in the Name and Description textboxes respectively.



  4. Select the database info service and database schema service from the drop-down list of Database Info and Schema Name respectively. 

    Database target can insert/update current date in the database. This current date is added in the input XML in two ways:

    • Source XML

    • Mapping

      It can be added through the source XML that has the current date already defined in its code.

      It can be added through mapping, if current date is defined as a constant in the Date field, or as a variable which has the value "Current Date". In this case, when mapping is done, then database target accesses the current date and inserts/updates it accordingly.

  5. Database Operation specifies how data records are inserted into database tables. Select one of the following database operations: 
    • Insert
    • Update
    • Insert/Update
    • Update/Insert

    Database Operation

    Effect on Database

    Insert

    This option is selected when you want to insert records into the database tables. If records already exist in the database table, new records are added in the database table along with existing records. When a column e.g. Company Name of database table is marked as Primary Key, more than one record cannot exist in the database table for the same Company Name. In this case if data of a company i.e. Microsoft Corporation already exist, insert operation fails and data is not inserted into the database.

    Update

    This option is selected when you want to update the existing record. To use updated option a column of database must be marked as Primary Key. When Update option is selected, database target first checks which column of the database table is marked as Primary Key. Suppose Company Name column is marked as Primary Key. Now database target check whether data of a company e.g. Microsoft Corporation already exist or not. If data for Microsoft Corporation already exists, database target updates the existing records. If none of the column is marked as Primary key, Update operation fails.

    Insert/Update

    This option is selected when the database target first tries to insert the data into database table. If insert operation fails, database target tries to update the data.

    Update/Insert

    This option is selected when the database target first tries to update the database table. If update operation fails, database target tries to insert the data.

     

    When an excel file is used as a database target, only Insert operation is supported. The Update, Insert/Update and Update/Insert operations are not supported. 
    When an excel file is used as a database target, the error records are not generated in case of data type mismatch.
  6. Expand Advanced Properties and select the project from the drop-down list of Project.
  7. Click Save.