Pages

Teradata Utility -- Tpump

Following are the features of Tpump utility in Teradata:
  • Allows near real-time updates from transactional systems into the warehouse.
  • Best fit for low volume data maintenance.
  • Unlike Multiload, Tpump uses row hash lock allows concurrent updates on the same table.
  • INSERT,UPDATE, DELETE supported.
  • No restrictions applied for tables with SI, RI, triggers etc.
  • No limit on number of concurrent sessions.
  • Speed can be tuned dynamically.
Example:

.LOGTABLE Logtable001_ml;
.LOGON  tdp3/user2,tyler;
.BEGIN LOAD SESSIONS 4 ERRORTABLE ET_Employee;
.LAYOUT Employee_Trans;
 .FILLER  in_Transcode   1  CHAR(3);
 .FIELD    in_EmpNo         *  SMALLINT;
 .FIELD    in_DeptNo         *  SMALLINT;
 .FIELD    in_Salary           *  DECIMAL (8,2);
.DML LABEL  Payroll   DO INSERT FOR MISSING UPDATE ROWS ;
 UPDATE  Employee  SET  Salary = :in_Salary
  WHERE  EmpNo = :in_EmpNo;
 INSERT  INTO  Employee  (EmpNo,  Salary)
  VALUES  (:in_EmpNo,  :in_Salary);
.DML LABEL Terminate ;
 DELETE  FROM  Employee  WHERE  EmpNo = :in_EmpNo;
 INSERT INTO Employee_History  (EmpNo, DeptNo)
  VALUES  (:in_EmpNo,  :in_DeptNo);
.IMPORT  INFILE  infile1
 LAYOUT  Employee_Trans
 APPLY  Payroll  WHERE  in_Transcode = 'PAY'
 APPLY  Terminate  WHERE  in_Transcode = 'DEL';
.END LOAD;
.LOGOFF;

0 comments:

Post a Comment