Updated on 2024-11-06 GMT+08:00

To a Relational Database

Sample JSON File

"to-config-values": {
        "configs": [
          {
            "inputs": [
              {
                "name": "toJobConfig.schemaName",
                "value": "cdm"
              },
              {
                "name": "toJobConfig.tablePreparation",
                "value": "DROP_AND_CREATE"
              },
              {
                "name": "toJobConfig.tableName",
                "value": "rf_to"
              },
              {
                "name": "toJobConfig.columnList",
                "value": "id&gid&name"
              },
              {
                "name": "toJobConfig.isCompress",
                "value": "false"
              },
              {
                "name": "toJobConfig.orientation",
                "value": "ROW"
              },
              {
                "name": "toJobConfig.useStageTable",
                "value": "false"
              },
              {
                "name": "toJobConfig.shouldClearTable",
                "value": "false"
              },
              {
                "name": "toJobConfig.extendCharLength",
                "value": "false"
              }
            ],
            "name": "toJobConfig"
          }
        ]
      }

Parameter Description

Parameter

Mandatory

Type

Description

toJobConfig.schemaName

Yes

String

Database mode or tablespace

toJobConfig.tablePreparation

Yes

Enumeration

This parameter is available only when both the source and destination databases are relational databases. The options for data write to tables are as follows:
  • DO_NOTHING: Do not create the table automatically.
  • CREATE_WHEN_NOT_EXIST: If the destination database does not contain the table specified by tableName, CDM automatically creates the table.
  • DROP_AND_CREATE: Delete the table specified by tableName, and then create the table again.

toJobConfig.tableName

Yes

String

Name of the table to which data is written

toJobConfig.columnList

No

String

List of fields to be loaded. Use & to separate field names. For example, id&gid&name.

toJobConfig.beforeImportType

No

Enumeration

Whether to clear the data in the target table before data import. The options are as follows:
  • none: Do not clear the data in the target table before data import but append data to the table.
  • shouldClearTable: Clear the data in the target table before data import.
  • whereClause: To clear data in the target table based on the WHERE clause, set the toJobConfig.whereClause parameter. CDM deletes the data from the target table as specified.

toJobConfig.whereClause

No

String

WHERE clause used to delete data from the target table before data import

toJobConfig.orientation

No

Enumeration

Storage mode. This parameter is enabled only for the DWS database. When the DWS database table needs to be automatically created, the optional data storage modes of the table are as follows:

  • ROW: Data in the table is stored in rows.
  • COLUMN: Data in the table is stored in columns.

toJobConfig.isCompress

No

Boolean

Whether to perform compression. This parameter is enabled only for the DWS database. When the DWS database table needs to be automatically created, you can specify whether to store the data in the table after compression.

toJobConfig.useStageTable

No

Boolean

Whether to import data to the phase table first. If this parameter is set to true, the data is imported to the phase table before it is imported to the destination table. After the data is successfully imported to the phase table, it is then imported from the phase table to the destination table. In this way, the data that is successfully imported to the destination table remains in case the data import fails.

toJobConfig.extendCharLength

No

Boolean

Whether to extend the length of the character string field. If this parameter is set to true, the length of the character string field in the destination table is three times the length of the corresponding field in the source table when the destination table needs to be automatically created.

toJobConfig.useNullable

No

Boolean

If you choose to create a target table automatically and specify the NOT NULL constraint, keep the NOT NULL constraints of the source and target tables consistent.