All Forums Tools
monchomark 4 posts Joined 07/16
06 Jul 2016
TPT EXPORT OPERATOR job structure

Hi guys, can you help me with a basic structure for a TPT EXPORT operator job?
I have good examples on LOAD operator but I'm not sure what to change ar what's needed.
This would be a load operator generic structure:

DEFINE JOB JOB_NAME
 (
       DEFINE OPERATOR LOAD_OPERATOR
       TYPE LOAD
       SCHEMA *
       ATTRIBUTES
       (
               VARCHAR UserName,
               VARCHAR UserPassword,
               VARCHAR LogTable,
               VARCHAR TargetTable,
               INTEGER BufferSize,
               INTEGER ErrorLimit,
               INTEGER MaxSessions = 20,
               INTEGER MinSessions,
               INTEGER TenacityHours,
               INTEGER TenacitySleep,
               VARCHAR AccountID,
               VARCHAR AmpCheck,
               VARCHAR DeleteTask,
               VARCHAR ErrorTable1,
               VARCHAR ErrorTable2,
               VARCHAR NotifyExit,
               VARCHAR NotifyExitIsDLL,
               VARCHAR NotifyLevel,
               VARCHAR NotifyMethod,
               VARCHAR NotifyString,
               VARCHAR PauseAcq,
               VARCHAR PrivateLogName,
               VARCHAR TdpId,
               VARCHAR TraceLevel,
               VARCHAR WorkingDatabase,
               VARCHAR WorkTable
        );
        DEFINE SCHEMA SCHEMA_NAME
        (
       FIELD1 TYPE,
       FIELD2 TYPE,
       FIELD3 TYPE
        );
        DEFINE OPERATOR READ_OPERATOR
        TYPE DATACONNECTOR PRODUCER
        SCHEMA SCHEMA_NAME
        ATTRIBUTES
        (
              VARCHAR FileName,
              VARCHAR Format,
              VARCHAR OpenMode,
              INTEGER BlockSize,
              INTEGER BufferSize,
              INTEGER RetentionPeriod,
              INTEGER RowsPerInstance,
              INTEGER SecondarySpace,
              INTEGER UnitCount,
              INTEGER VolumeCount,
              VARCHAR AccessModuleName,
              VARCHAR AccessModuleInitStr,
              VARCHAR ArchiveDirectoryPath,
              VARCHAR DirectoryPath,
              VARCHAR ExpirationDate,
              VARCHAR IndicatorMode,
              VARCHAR PrimarySpace,
              VARCHAR PrivateLogName,
              VARCHAR RecordFormat,
              VARCHAR RecordLength,
              VARCHAR SpaceUnit,
              VARCHAR TextDelimiter,
              VARCHAR VolSerNumber,
              VARCHAR UnitType,
              VARCHAR RowErrFileName
        );
        STEP Load_Records (
        APPLY
        (
          'INSERT INTO TABLE_NAME (
                                FIELD1,
                                FIELD2,
                                FIELD3
            )
        VALUES  (
                                :FIELD1,
                                :FIELD2,
                                :FIELD3
                                 );'
       )
       TO OPERATOR
       (
           LOAD_OPERATOR[1]
           ATTRIBUTES
           (
              UserName =USER_NAME
              UserPassword =PASSWD
              LogTable =LOGTABLE_NAME
              TargetTable =TARGET_TABLE_NAME
              WorkingDatabase =DB_SCHEMA_NAME
              TdpId =ID (?)
           )
       )
       SELECT * FROM OPERATOR
       (
          READ_OPERATOR[1]
          ATTRIBUTES
          (
             FileName =FILE_NAME
             Format ='DELIMITED',
             OpenMode ='Read',
             DirectoryPath =PATH1
             ArchiveDirectoryPath =PATH2
             RowErrFileName=FILE_NAME
             IndicatorMode ='N',
             TextDelimiter ='~'
          )
      );
      );
);
So, how would the export one be?
 
thanks in advance,

 

feinholz 1234 posts Joined 05/08
06 Jul 2016

Our documentation describes the Export operator, the mandatory attributes and the optional ones.
Our User Guide has examples of Export operator job scripts as well.
We also ship sample scripts with the product. Just look in the "samples" directory under the TPT root install directory.
 
What type of scenario are you looking for?
What version of TPT are you using?

--SteveF

monchomark 4 posts Joined 07/16
07 Jul 2016

hi feinholz, yes I've been looking both the tpt user guide and the tpt reference manual, didn't find full examples.
I was hoping for a minimal or standard query-to-file structure, I can't tell from the load one how to change it. At the moment I'm trying to adapt the load one.
That samples dir could be it, I'm going to check-
thanks!

monchomark 4 posts Joined 07/16
07 Jul 2016

I'm looking at these paths but no tpl file samples to be found,
./client/13.10/sample
./client/13.10/odbc_32/samples
./client/13.10/odbc_64/samples
./client/13.10/tbuild/sample
./client/13.10/tbuild/tptapi/sample
./client/13.10/tbuild/tptapi/sample/dynlnk_sample
 

dnoeth 4628 posts Joined 11/04
07 Jul 2016

http://www.info.teradata.com/HTMLPubs/DB_TTU_13_10/index.html#page/Load_and_Unload_Utilities/B035_2445_020A/2445appA.32.26.html#ww10737921
I don't know if the location changed, but the sample directory is usually found at /opt/teradata/client/xx.xx/tbuild/samples/userguide
 
Btw, TTU 13.10 is a very outdated and no longer supported release.

Dieter

monchomark 4 posts Joined 07/16
07 Jul 2016

thanks again,
I got another good example from here:
http://teradatafaqs.blogspot.ie/2013/11/73-teradata-parallel-transporter-export.html

You must sign in to leave a comment.