TPT Export Assistance

Tools & Utilities
Teradata Employee

TPT Export Assistance

I am attempting to extract pipe delimited data from Teradata Express using TPT.  I am using TPT version 15.00.00.00.

My output gives me fully padded output (with a lot of whitespace). Also, I am getting a 2 digit year. I have tried changing the SCHEMA but it either gives me an error or makes no difference on the output. Any assistance would be helpful.

The DDL of the table is:

CREATE MULTISET TABLE MLB.batterRE24

     (

      GameDate DATE,

      BatterId INTEGER,

      BatterName VARCHAR(50),

      PitcherRE24 DECIMAL(6,2),

      BatterRE24 DECIMAL(6,2),

      PitcherRE24PPA DECIMAL(6,2),

      BatterRE24PPA DECIMAL(6,2),

      AtBats INTEGER,

      RowNumber INTEGER)

PRIMARY INDEX ( BatterId );

My TPT script is:

DEFINE JOB EXPORT_DELIMITED

DESCRIPTION 'Export TD table to a delimited file'

(

DEFINE SCHEMA SOURCE_SCHEMA

(

 GameDate   varchar(10)

,BatterId   varchar(11)

,BatterName   varchar(50)

,PitcherRE24   varchar(8)

,BatterRE24   varchar(8)

,PitcherRE24PPA   varchar(8)

,BatterRE24PPA   varchar(8)

,AtBats   varchar(11)

,RowNumber   varchar(11)

);

DEFINE OPERATOR SQL_SELECTOR

TYPE SELECTOR

SCHEMA SOURCE_SCHEMA

ATTRIBUTES

(

 VARCHAR PrivateLogName = 'private_log'

,VARCHAR TDPID = 'MLB'

,VARCHAR UserName = 'dbc'

,VARCHAR UserPassword = 'dbc'

,VARCHAR SelectStmt =  'select

  TRIM(CAST(GameDate as char(10)))

 ,BatterId

 ,BatterName

 ,PitcherRE24

 ,BatterRE24

 ,PitcherRE24PPA

 ,BatterRE24PPA

 ,AtBats

 ,RowNumber

 from MLB.batterRE24;'

,VARCHAR ReportModeOn = 'Yes'

);

DEFINE OPERATOR FILE_WRITER

TYPE DATACONNECTOR CONSUMER

SCHEMA *

ATTRIBUTES

(

VARCHAR PrivateLogName = 'run_log'

,VARCHAR DirectoryPath = 'c:\td_vm\data\'

,VARCHAR FileName = 'MLB_batterRE24.txt'

,VARCHAR Format = 'DELIMITED'

,VARCHAR OpenMode = 'Write'

,VARCHAR TextDelimiter = '|'

,VARCHAR TRACELEVEL = 'ALL'

);

APPLY TO OPERATOR (FILE_WRITER)

SELECT * FROM OPERATOR (SQL_SELECTOR);

);