BEGIN MLOAD

Translation specification for the BEGIN MLOAD and related commands.

The transformation for the command .BEGIN MLOAD is a multi-part transformation that requires the .LAYOUT, .FIELD, .FILLER,.DML LABEL, and .IMPORT commands to simulate its behavior correctly.

This transformation is fully explained in the following subsections.

.LAYOUT, .FIELD and .FILLER

The transformation for the commands .LAYOUT, .FIELD, and .FILLER will create variable definitions to be used in a future function call of the IMPORT of this layout.

Teradata (MultiLoad)

.LAYOUT INFILE_LAYOUT;
.FIELD TABLE_ID        * INTEGER;
.FIELD TABLE_DESCR     * CHAR(8);
.FILLER COL1           * CHAR(1);
.FIELD TABLE_NBR       * SMALLINT;
.FIELD TABLE_SOMEFIELD * SMALLINT;

Snowflake (Python)

  INFILE_LAYOUT_TableName = "INFILE_LAYOUT_TEMP_TABLE"
  INFILE_LAYOUT_Columns = """TABLE_ID INTEGER, 
TABLE_DESCR CHAR(8), 
COL1 CHAR(1), 
TABLE_NBR SMALLINT, 
TABLE_SOMEFIELD SMALLINT"""
  INFILE_LAYOUT_Conditions = """TABLE_ID AS TABLE_ID, TABLE_DESCR AS TABLE_DESCR, COL1 AS COL1, TABLE_NBR AS TABLE_NBR, TABLE_SOMEFIELD AS TABLE_SOMEFIELD"""

.DML LABEL

The transformation for the .DML LABELcommand will create a function containing the statements after the label definition. Note that after the .DML LABEL command there is usually an Insert, Update or Delete.

Teradata (MultiLoad)

Snowflake (Python)

.IMPORT

The transformation of the .IMPORT command will create a call to theimport_file_to_temptablehelper to load the data from the file to a temporary table. Then, the calls to all theAPPLYlabels used in the original import will be created. Finally, the calls for anINSERTlabel will be transformed to a query parameter and optionally can have a query condition.

Teradata (MultiLoad)

Snowflake (Python)

Large Example

Given the transformations shown above for a variety of commands, consider the following example.

With this input data:

Teradata (MultiLoad)

Snowflake (Python)

Known Issues

1. Delete statement is partially supported

The DELETE statement is partially supported since the where conditions, when found, are not being converted correctly if pointing to a LAYOUT defined column.

In the example below, :EmpNo is pointing to a LAYOUT defined column. However, the transformation does not take this into account and thus the code will be referencing a column that does not exists.

If you have any additional questions regarding this documentation, you can email us at [email protected].

Last updated

Was this helpful?