kunal

Tools
Enthusiast

kunal

i am using below mentioned script for data load from text file having data

100kunal
444rohit

but data is loaded incorrectly in table as

id name
|44 4rohi
100 kunal

script is:

.logon DemoTd/USER1,*******;

.logtable USER1.logtable_temp;

database USER1;

create table USER1.temp (
id char(3),
name char(5)
);
.begin import mload tables USER1.temp
worktables
USER1.worktable_Test2_Mload
ERRORTABLES USER1.err_temp USER1.err4_temp

;

.layout layout_Test_Mload;
.field id * CHAR(3);
.field name * CHAR(5);
.filler field * char(1);

.dml label dml_Test_Mload;
insert into USER1.temp
values (:id,:name );
.import infile 'c:\t2.txt'
format UNFORMAT
layout layout_Test_Mload
apply dml_Test_Mload;
.end mload;

.LOGOFF;

Please suggest me what's the problem with this script.

thanks and regards,
Kunal
3 REPLIES
Enthusiast

Re: kunal

Hi Kunal,

If your file structure is as following
100kunal
444rohit
then as mentioned in your script, there is no need of the filler.

Following is the correct script.

.logtable USER1.logtable_temp;

.logon DemoTd/USER1,*******;

database USER1;

.begin import mload tables USER1.temp
worktables USER1.worktable_Test2_Mload
ERRORTABLES USER1.err_temp USER1.err4_temp;

.layout layout_Test_Mload;
.field id * CHAR(3);
.field name * CHAR(5);

.dml label dml_Test_Mload;

insert into USER1.temp
values (:id,:name );
.import infile 'c:\test.txt'

layout layout_Test_Mload
apply dml_Test_Mload;
.end mload;

.LOGOFF;

Please note that i have changed format as well to text.

Please let me know in case of any other issues.

Enthusiast

Re: kunal

Hi Kunal,

If your file structure is as following
100kunal
444rohit
then as mentioned in your script, there is no need of the filler.

Following is the correct script.

.logtable USER1.logtable_temp;

.logon DemoTd/USER1,*******;

database USER1;

.begin import mload tables USER1.temp
worktables USER1.worktable_Test2_Mload
ERRORTABLES USER1.err_temp USER1.err4_temp;

.layout layout_Test_Mload;
.field id * CHAR(3);
.field name * CHAR(5);

.dml label dml_Test_Mload;

insert into USER1.temp
values (:id,:name );
.import infile 'c:\test.txt'
format text
layout layout_Test_Mload
apply dml_Test_Mload;
.end mload;

.LOGOFF;

Please note that i have changed format as well to text.

Please let me know in case of any other issues.

Dhiraj P

Re: kunal

Hi Friends ,
i am prasad from chennai,i just learn teradata,i also completed II level in certification

i dont know how to write MLOAD,FASTLOAD,FASTEXPORT,Tpump Scripts

IF U have any material or sample Scripts Plz mail to me prasadu8055@gmail.com

waiting for Positive reply

Thanks&regads
prasad