BEGIN MLOAD

Translation specification for the BEGIN MLOAD and related commands.

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

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)

IN -> Teradata_01.mload
.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)

OUT -> Teradata_01.py
#*** Generated code is based on the SnowConvert Python Helpers version 2.0.6 ***
 
import os
import sys
import snowconvert.helpers
from snowconvert.helpers import Export
from snowconvert.helpers import exec
from snowconvert.helpers import BeginLoading
con = None
def main():
  snowconvert.helpers.configure_log()
  con = snowconvert.helpers.log_on()
  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"""
  snowconvert.helpers.quit_application()

if __name__ == "__main__":
  main()

.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].

  1. SSC-FDM-0027: Removed next statement, not applicable in SnowFlake.

Last updated