Reading Data from a Database for a Batch Script - trillium_discovery - trillium_quality - Latest

Trillium Control Center

Product type
Software
Portfolio
Verify
Product family
Trillium
Product
Trillium > Trillium Discovery
Version
Latest
Language
English
Product name
Trillium Quality and Discovery
Title
Trillium Control Center
Copyright
2024
First publish date
2008
Last updated
2024-10-18
Published on
2024-10-18T15:02:04.502478

When you are using an entity created from a relational data source, you have the option to load data from the database for a batch script. By specifying a database table name, you can configure a batch script to extract the data directly from the database, route it to your project and run it through the process flow. By adding a Database Write process at any point in the project, you can write back outputs to the database.

Guidelines: Note the following guidelines when using the database read function:
  • After the loader connection is established, you need to create an entity using the database as a data source and create a project. You can use both dynamic and real entities.
  • If you are reading a large number of rows, consider doing one of the following to optimize performance:
    • Define an SQL Where clause in the Create Entity Wizard to filter the data.
    • Select Use pipes in Script Options in the Export Project Options window to pipe the data through the project's processes.
  • The maximum attribute size is 32KB for database read/write. Attributes that are bigger than 32KB such as Text fields in SQL Database will be truncated.

To read data from a database for a batch export

  1. Create a Quality project using an input entity with a database data source, and configure and run the project as you normally would.
  2. From the Navigation or Project View, right-click the project and select Export. The Export Project Options window opens.
  3. Specify the options for the location and type. See Exporting a Project to a Batch Script or Exporting a Project Definition.
  4. Select the Include database source data with export box to enable the database option. The Include Database Read for table_name options will be displayed.
  5. Enter Username and Password for the database.
  6. (Optional) The password is always displayed in the control file (STX file). If you want the password to display encrypted, select Encrypt Password.
    Note: The password option will become the Reset password option after encryption. The next time you enter the username and password, check the Reset password option and re-enter your password.

    Options for Database Read

  7. Select Validate Database Connection(s) to validate the database connection.
  8. Specify the rest of the options.
  9. Click Export.
  10. Once the batch script is created, open the script and verify that the database read command is inserted at the beginning of the script.

    Example

    ........................................................................

    ::

    :: TSQDA - Database Read(9034)

    :: This is a Database Read process

    ::

    ::........................................

    call "%TS_BIN%\tsqda" "%TS_SETTINGS%\xxtsqda_p9034.stx" "%TS_LOGS%\xxtsqda_ p9034.err"

    ::.....................................................................

    The data will be loaded from the database when the batch script is run.

  11. If you want to return the results to the database, see Writing Back Data to a Database.