tpt & mload difference

General

tpt & mload difference

Hi

what is the major differeces between mload n tpt ?

4 REPLIES
N/A

Re: tpt & mload difference


Hi,



In Tpt we can use multiple load options at a time in a single script.for every standalone utilities like fastload,multiload,tpump here we have operators for those utilities.we can use multiple utilities in a single script.



And another advantage is we can create multiple instances for single operator.



 



 


Re: tpt & mload difference


thanks raj..



can you provide sample script for tpt?



 



 


N/A

Re: tpt & mload difference

Here this is script for loading the data from file to table using tpt

N/A

Re: tpt & mload difference

DEFINE JOB FILE_LOAD

DESCRIPTION 'LOAD A TERADATA TABLE FROM A FILE'

(

 DEFINE SCHEMA Emp_Schema

 (

  Empid INTEGER,

  Ename VARCHAR(20),

  Loc   VARCHAR(20),

  DeptNo INTEGER,

  Dname VARCHAR(20)

 );

 DEFINE OPERATOR DDL_OPERATOR

 TYPE DDL

 ATTRIBUTES

 (

 VARCHAR PrivateLogName ='emp_ddl_log',

 VARCHAR TdpId        =@jtdpid,

 VARCHAR UserName       =@user,

 VARCHAR UserPassword   =@pwd,

 VARCHAR ErrorList      ='3807'

 );

 DEFINE OPERATOR FILE_READER

 TYPE DATACONNECTOR PRODUCER

 SCHEMA Emp_Schema

 ATTRIBUTES

 (

 VARCHAR PrivateLogName = 'dataconnector_log',

 VARCHAR DirectoryPath = @jpath,

 VARCHAR FileName = 'input.txt',

 VARCHAR Format = 'Delimited',

 VARCHAR OpenMode = 'Read',

 VARCHAR TextDelimiter = ','

 );

 DEFINE OPERATOR LOAD_OPERATOR

 TYPE LOAD

 SCHEMA *

 ATTRIBUTES

 (

 VARCHAR PrivateLogName        = 'load_log',

 VARCHAR TdpId    = @jobvar_tdpid,

 VARCHAR UserName   = @jobvar_username,

 VARCHAR UserPassword   = @jobvar_password,

 VARCHAR TargetTable   = @tgt_dbname || '.Trans',

 VARCHAR LogTable   = @wrk_dbname || '.LG_Trans',

 VARCHAR ErrorTable1   = @wrk_dbname || '.ET_Trans',

 VARCHAR ErrorTable2   = @wrk_dbname || '.UV_Trans'

 );

 STEP Setup_Tables

 (

 APPLY

 ('DROP TABLE ' || @wrk_dbname || '.ET_Trans;'),

 ('DROP TABLE ' || @wrk_dbname || '.UV_Trans;'),

 ('DROP TABLE ' || @tgt_dbname || '.Trans;'),

 ('CREATE TABLE ' || @tgt_dbname

 || '.Trans (Empid INTEGER,

      Ename VARCHAR(20),

      Loc VARCHAR(20),

      DeptNo INTEGER,

      Dname VARCHAR(20));')

 TO OPERATOR (DDL_OPERATOR);

 );

 STEP Load_Emp_Table

 (

 APPLY

 ('INSERT INTO ' || @tgt_dbname || '.Trans(Empid,

 Ename,

 Loc,

 DeptNO,

 Dname)

 VALUES(:Empid,

 :Ename,

 :Loc,

 :DeptNo,

 :Dname);')

 TO OPERATOR (LOAD_OPERATOR[2])

 SELECT * FROM OPERATOR(FILE_READER[2]);

 );

);