Skip to main content Skip to complementary content

Null management for an AS/400 IBMi source and a Snowflake target

The SQL command file DD_SnowLoad.sql is used for null management.

About this task

Procedure

  1. To activate null management, you must check that the SnowFlakeTarget.Copy parameter in the DD_USRDATA.DD_PARAM table is up-to-date.
    Use the following query: UPDATE DD_USRDATA.DD_PARAM SET PARVAL = 'copy into "&dbname"."&schemaname".&snowtable from @~/&snowfile file_format = (type=csv FIELD_OPTIONALLY_ENCLOSED_BY = ''"'' ESCAPE =''\\'' TRIM_SPACE = TRUE);' WHERE PARNAME='SnowFlakeTarget.Copy'
    Information noteWarning: If other parameters have been added, you need to update this query with those parameters.
  2. For other needs, follow the null option rules for AS/400 IBMi as a source and Snowflake as a target:
    Null Type Rule
    Yes Alpha The blanks to the right are deleted.

    If the field is empty, "" is sent.

    If the field is null, null is sent.
    No Alpha The blanks to the right are not deleted.

    If the field is null, "" is sent.

    Rtrim Alpha The blanks to the right are deleted.

    If the field is empty, " " is sent.

    If the field is null, "" is sent.

    Idem Alpha

    No processing, empty are empty, null are null, varchar are varchar, nvarchar are nvarchar.

    The blanks to the right are not deleted for varchar.

    The blanks to the right are deleted for nvarchar (nvarchar are forced to RTRIM).

    Null Type Rule
    Yes Numeric If the value contained in the field is 0, then Null is sent.
    No Numeric If the value contained in the field is null, then 0 is sent.
    Idem Numeric Null are null, 0 are 0.
    Rtrim Numeric  
    Null Type Rule
    Yes Date Null are null, date are date.
    No Date Null are null, date are date.
    Idem Date Null are null, date are date.
    Rtrim Date Null are null, date are date.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!