Creating Database Target Activity

The Database Target activity provides the ability to specify a database as target. This section describes how to create a Database Source activity.

Prerequisites

Ensure that you have created Database Info activity and Database Layout.


Steps to create a Database Target Activity

  1. Click Configure > TARGETS > Database Target.



  2. Click CREATE Database Target.



  3. On Create Database Target window, enter the name and description of the new Database Target in the Name and Description textboxes respectively.



  4. Select the database info activity and database schema activity 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

    The effect that the selection has on the database is listed in the table below.

    A field defined as a primary key at the schema level does not qualify to act as a primary key for the database. You need to set that field as a primary key at the database level too. 

    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.

    If the specified database operation fails on any source data, error records are created. 
     
    To learn, how to use Process Designer, refer to the section Using Process Designer. 
    To learn how to handle error records, refer to the section Handling Error Records.
    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 of the activity from the drop-down list of Project.



  7. Click Save.


    Â