vaibhav kumar
vaibhav kumar

Reputation: 11

T-PUMP DML ERROR

While running T-PUMP I'm getting DML error. Here is my script that is loading data from a file to a table infa_source12:

.LOGTABLE  etlt5.EMP_TPUMP_LOG;
.logon ttdbia/USR/PASSWRD;
.BEGIN LOAD;
PACK 5
RATE 10
ERROR TABLE Etlt5.TPUMPERROR;
.LAYOUT RECLAYOUT;
.FIELD    id        * varchar(10);
.FIELD    name      * varchar(20);
.FIELD    country   * varCHAR(30);

.DML label INST;

INSERT INTO etlt5.infa_source12
(id,name,country)
VALUES 
(:id, :name, :country) 
.IMPORT INFINE /home/a0c9sx/SQLAExport.txt;
LAYOUT RECLAYOUT
APPLY INST ;
.END LOAD;
.LOGOFF;
ERROR:
**** 10:18:50 UTY2832 A .DML statement must be entered before any SQL

I referred to the below link:

http://www.teradatawiki.net/2013/10/Teradatautilities-tpump.html

Upvotes: 0

Views: 127

Answers (2)

dnoeth
dnoeth

Reputation: 60482

Your script is full of synax errors (copied from that website):

.LOGTABLE  etlt5.EMP_TPUMP_LOG;
.logon ttdbia/USR/PASSWRD;
.BEGIN LOAD; -- no semicolon, the next keywords are part of BEGIN LOAD
        -- SESSIONS is missing
 PACK 5
 RATE 10
 ERROR TABLE Etlt5.TPUMPERROR; -- no space between ERROR and TABLE
.LAYOUT RECLAYOUT;
.FIELD    id        * varchar(10);
.FIELD    name      * varchar(20);
.FIELD    country   * varCHAR(30);

.DML label INST; 

INSERT INTO etlt5.infa_source12
(id,name,country)
VALUES 
(:id, :name, :country)  -- missing semicolon, needed for each SQL statement
.IMPORT INFINE /home/a0c9sx/SQLAExport.txt; -- no semicolon, the next keywords are part of IMPORT
LAYOUT RECLAYOUT
APPLY INST ;
.END LOAD;
.LOGOFF;

It will save more time when you follow the examples found in the manuals...

Upvotes: 1

Rob Paller
Rob Paller

Reputation: 7786

It seems that you are missing part of the command syntax for the .DML command. What isn't clear is whether or not you need to use SERIALIZEON or not.

.LOGTABLE  etlt5.EMP_TPUMP_LOG;
.logon ttdbia/USR/PASSWRD;
.BEGIN LOAD;
PACK 5
RATE 10
ERROR TABLE Etlt5.TPUMPERROR;
.LAYOUT RECLAYOUT;
.FIELD    id        * varchar(10);
.FIELD    name      * varchar(20);
.FIELD    country   * varCHAR(30);

.DML LABEL INST
  DO INSERT FOR;

INSERT INTO etlt5.infa_source12
(id,name,country)
VALUES 
(:id, :name, :country) 
.IMPORT INFINE /home/a0c9sx/SQLAExport.txt;
LAYOUT RECLAYOUT
APPLY INST ;
.END LOAD;
.LOGOFF;

There is more information on the T-Pump command syntax in the Teradata Manuals here.

Upvotes: 0

Related Questions