Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sun, 09 Dec 2012 @ 10:30:16 GMT


     
  <Prev Next>  
<<First
<Prev
Next> Last>>  


Subj:   TPT - Filter condition.
 
From:   Mani, Vijay

Hi ,

I am trying to load the table using TPT , my source is a delimited file. I need to omit those records while loading for which the amount field (say f1) having value greater than 1000.

I am not sure on where should I give this condition. ?Can someone help me on this please? I have used update operator to load the table as my table will have duplicate values.

Please find below my TPT script

     DEFINE JOB FORKLIFT_LOAD
     (

     DEFINE SCHEMA File_Schema
     (
     F1 varchar(350)
     F2 varchar(350)
     )

     DEFINE OPERATOR File_Reader
     TYPE DATACONNECTOR PRODUCER
     SCHEMA File_Schema
     ATTRIBUTES
     (
     VARCHAR DirectoryPath = @tmpdir,
     VARCHAR FileName = 'file1_pipe',
     VARCHAR Format = 'Delimited',
     VARCHAR OpenMode = 'Read',
     VARCHAR TextDelimiter = '?',
     VARCHAR AccessModuleName = 'np_axsmod.so',

     DEFINE OPERATOR File_Loader
     TYPE UPDATE
     SCHEMA *
     ATTRIBUTES
     (
     VARCHAR TdpId = @tdhost,
     VARCHAR UserName = @tduser,
     VARCHAR UserPassword = @tdpasswd,
     VARCHAR TargetTable = 'Table1',
     VARCHAR LogTable = 'LOG1',
     VARCHAR ErrorTable1 = 'T1_ET',
     VARCHAR WorkTable = 'T1?,
     INTEGER MaxSessions = 30,
     INTEGER MinSessions = 10
     );

     STEP Load_Table
     (
     APPLY
     ('INSERT INTO Table1(
     F1,
     F2)
     Values(:f1,:f2 );')
     TO OPERATOR (File_Loader[2])
     SELECT * FROM OPERATOR(File_Reader[1])

Thanks,

Vijay Mani



     
  <Prev Next>  
<<First
<Prev
Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 27 Dec 2016