teradatabulk-load

How do I utilize the TPT FileName attribute to list multiple files?


The documentation of Teradata's tbuild bulk utility states that I can list multiple files if I set FileList = 'Y'. It does not, however, mention how to do so.

Teradata Docs

I have tried something similar to this:

VARCHAR FileList = 'YES',
VARCHAR FileName        = '\\path\to\file\file1.csv',
'\\path\to\file\file2.csv',
'\\path\to\file\file3.csv',
'\\path\to\file\file4.csv'

Which fails with this error (one for each file). This is the same error that occurs if I attempt to surround the entire thing with parenthesis:

TPT_INFRA: Syntax error at or near line 30 of Job Script File 'File_list_test.sql':
TPT_INFRA: At "\\path\to\file\file1.csv" missing { ARRAY_ BIGINT_ BYTEINT_ CHARACTER_ CHAR_ CHARACTERS_ CHARS_ INT_ INTEGER_ LONG_ SMALLINT_ VARCHAR_ VARDATE_ REGULAR_IDENTIFIER_ EXTENDED_IDENTIFIER_ EXTENDED_IDENTIFIER_NO_N_ } in Rule: Attribute Definition

I've tried to surround the entire list in double quotes. That fails with this error:

TPT_INFRA: At "'\\path\to\file\file1.csv','\\path\to\file\file2.csv','\\path\to\file\file3.csv','\\path\to\file\file4.csv'" missing { PLUS_ MINUS_ JOB_ATTRIBUTE_REFERENCE_ EXTENDED_LITERAL_ CHAR_STRING_LITERAL_ UNSIGNED_INTEGER_ EXACT_NUMERIC_VALUE_ APPROX_NUMERIC_VALUE_ } in Rule: Initial Value

I've tried to surround the entire list with square brackets which fails with this error:

TPT_INFRA: At "VARCHAR" missing RPAREN_ in Rule: Attribute List Definition

I've also tried to set VARCHAR FileName = to each file. Predictably, that fails with this error:

TPT_INFRA: TPT03044: Attribute 'FileName' is already on Operator 'My_DataConnector_Test' attribute list.
Duplicate definition is rejected.

How do I provide a file list so that I can load selected files via the tbuild utility?


Solution

  • I had the same problem a few years ago when I tried FileList the first time :-)

    You just have to read the manuals carefully:

    the file specified by FileName contains a list of files to be processed.

    When used with the FileList attribute, fileName is expected to contain a list of names of the files to be processed, each with a full path specification

    The file specified by FileName must be a text file with each file name on a new line.

    This is the content of the file "myfile.txt":

    \\path\to\file\file1.csv
    \\path\to\file\file2.csv
    \\path\to\file\file3.csv
    \\path\to\file\file4.csv
    

    And now "myfile.txt" is the file used in TPT:

    VARCHAR FileList = 'YES',
    VARCHAR FileName = 'myfile.txt'