August 15, 2023

tCreateTable – Docs for ESB 6.x

tCreateTable

Creates a table for a specific type of database.

tCreateTable Standard properties

These properties are used to configure tCreateTable running in
the Standard Job framework.

The Standard
tCreateTable component belongs to the Databases family.

The component in this framework is generally available.

Basic settings

Database Type

Select the type of the database. The connection properties may differ slightly
according to the database type selected.

Property Type

Select the way the connection details
will be set.

  • Built-In: The connection details will be set
    locally for this component. You need to specify the values for all
    related connection properties manually.

  • Repository: The connection details stored
    centrally in Repository > Metadata will be reused by this component. You need to click
    the […] button next to it and in the pop-up
    Repository Content dialog box, select the
    connection details to be reused, and all related connection
    properties will be automatically filled in.

Use an existing connection

Select this check box and in the Component
List
click the relevant connection component to reuse the connection
details you already defined.

When a Job contains the parent Job and the child Job, if you need to share an existing
connection between the two levels, for example, to share the connection created by the
parent Job with the child Job, you have to:

  1. In the parent level, register the database connection to be shared in the
    Basic settings view of the connection component which
    creates that very database connection.

  2. In the child level, use a dedicated connection component to read that registered
    database connection.

For an example about how to share a database connection across Job levels, see

Talend Studio
User Guide
.

DB Version

Select the version of the database.

Host

The IP address or hostname of the database.

Port

The listening port number of the database.

Database name

The name of the database.

Schema

The name of the database schema.

This property is available for DB2, Exasol, Greenplum,
Informix, MS SQL Server, Oracle, PostgresPlus, Postgresql, Redshift,
Sybase, and Vertica database types.

Access File

The path to the Access database file.

Firebird File

The path to the Firebird database file.

Interbase File

The path to the Interbase database file.

SQLite File

The path to the SQLite database file.

Running Mode

Select the Server Mode that corresponds to your database setup.

This property is available only for the HSQLDb database type.

Use TLS/SSL Sockets

Select this check box to enable the security mode if required.

This property is available only for the HSQLDb database type.

DB Alias

The name of the database.

This property is available only for the HSQLDb database type.

Framework Type

Select the framework type for your database.

This property is available only for the JavaDb database type.

DB Root Path

Browse to your database root.

This property is available only for the JavaDb database type.

ODBC Name

The name of the ODBC database.

Connection Type

Select the Oracle database connection type.

  • Oracle SID: select this connection type to uniquely
    identify a particular database on a system.

  • Oracle Service: select this connection type to use the TNS
    alias that you give when you connect to the remote database.

  • Oracle OCI: select this connection type to use Oracle Call
    Interface with a set of C-language software APIs that provide an interface to the
    Oracle database.

  • Oracle Custom: select this connection type to access a
    clustered database.

  • WALLET: select this connection type to store credentials
    in an Oracle wallet.

Username and Password

The database user authentication data.

To enter the password, click the […] button next to the
password field, and then in the pop-up dialog box enter the password between double quotes
and click OK to save the settings.

Table name

The name of the table to be created.

Table Action

Select the action to be carried out on the table.

  • Create table: the specified table doesn’t
    exist and gets created.

  • Create table if not exists: the specified
    table is created if it does not exist.

  • Drop table if exits and create: the table
    is removed if it already exists and gets created again.

Case Sensitive

Select this check box to make the table/column name case sensitive.

This property is available only for the HSQLDb database type.

Temporary Table

Select this check box if you want to save the created table
temporarily.

This property is available only for the MySQL database type.

Create

Select the type of the table to be created.

  • SET TABLE: the table that does not allow
    duplicate rows.

  • MULTISET TABLE: the table that allows
    duplicate rows.

This property is available only for the Teradata database type.

Schema and
Edit Schema

A schema is a row description. It defines the number of fields (columns) to
be processed and passed on to the next component. The schema is either Built-In or stored remotely in the Repository.

  • Built-In: You create and store the
    schema locally for this component only. Related topic: see
    Talend Studio

    User Guide.

  • Repository: You have already created
    the schema and stored it in the Repository. You can reuse it in various projects and
    Job designs. Related topic: see
    Talend Studio

    User Guide.

When the schema to be reused has default values that are integers or
functions, ensure that these default values are not enclosed within quotation marks. If
they are, you must remove the quotation marks manually.

You can find more details about how to verify default
values in retrieved schema in Talend Help Center (https://help.talend.com).

Click Edit schema to make changes to the schema.
If the current schema is of the Repository type, three
options are available:

  • View schema: choose this option to view the
    schema only.

  • Change to built-in property: choose this
    option to change the schema to Built-in for
    local changes.

  • Update repository connection: choose this
    option to change the schema stored in the repository and decide whether to propagate
    the changes to all the Jobs upon completion. If you just want to propagate the
    changes to the current Job, you can select No
    upon completion and choose this schema metadata again in the [Repository Content] window.

Advanced settings

Additional JDBC Parameters

Specify additional connection properties for the DB connection you are
creating. This option is not available if you have selected the
Use an existing connection check box in the
Basic settings.

This property is available for the AS/400 and MSSQL Server database
types.

Create projection

Select this check box to create a projection.

This property is available only for the Vertica database type.

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at the Job level
as well as at each component level.

Global Variables

QUERY

The query statement being processed. This is a Flow variable and it returns a
string.

ERROR_MESSAGE

The error message generated by the component when an error occurs. This is an After
variable and it returns a string.

Usage

Usage rule

This component can be used as a standalone component of a Job or Subjob.

Scenario: Creating new table in a Mysql Database

The Job described below aims at creating a table in a database, made of a dummy schema taken from a delimited file schema
stored in the Repository. This Job is composed of a single
component.

Use_Case_tCreateTable1.png

Procedure

  1. Drop a tCreateTable component from the
    Databases family in the Palette to the design workspace.
  2. In the Basic settings view, and from the
    Database Type list, select Mysql for this
    scenario.

    Use_Case_tCreateTable2.png

  3. From the Table Action list, select Create table.
  4. Select the Use Existing Connection check box
    only if you are using a dedicated DB connection component tMysqlConnection. In this example, we won’t use this
    option.

  5. In the Property type field, select Repository so that the connection fields that
    follow are automatically filled in. If you have not defined your DB
    connection metadata in the DB connection
    directory under the Metadata node, fill in
    the details manually as Built-in
    .
  6. In the Table Name field, fill in a name for
    the table to be created.
  7. If you want to retrieve the Schema from the
    Metadata (it doesn’t need to be a DB connection Schema metadata), select
    Repository then the relevant entry.
  8. In any case (Built-in or Repository)
    click Edit Schema to check the data type
    mappingClick Edit Schema
    to define the data structure
    .

    Use_Case_tCreateTable3.png

  9. Click the Reset DB Types button in case the
    DB type column is empty or shows discrepancies (marked in orange). This allows
    you to map any data type to the relevant DB data type. Then, click OK to validate your changes and close the dialog
    box.
  10. Save your Job and press F6 to execute
    it.

The table is created empty but with all columns defined in the Schema.

Use_Case_tCreateTable4.png


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x