Error while loading data using fastload utility

Tools
Enthusiast

Error while loading data using fastload utility

Hi,
I am trying to load two records from a notepad into a table using fastload utility, its working fine if there

is a single record, but when i add a newlinechar(char(1)), if am getting the below error.

0006 insert into samples.saat3
(:name,
:id);

Number of recs/msgs: 3780
Starting to send to RDBMS with 1 record
Incorrect number of bytes returned from a File Read!
Expected: 12, Received:2

The below are the scripts used:

Records present in the notepad:
raghu 300 |
ram 200 |

Scripts in fastload utility
.logon 127.0.0.1/dbc,dbc;

create table samples.saat3
(name char(5),
id char(3)
);

set record unformatted;

define delim0(char(1)),
name(char(5)),delim1(char(1)),
id(char(3)),delim2(char(1)),
newlinechar(char(1))
file=e:/satish/materials/teradata/insert.input.txt;

define statement processed

when i give show command the total record length=12

begin loading samples.saat3 errorfiles samples.abc15,samples.abc16;
Number of amps available =2
BEGIN LOADING COMPLETE

insert into samples.saat3
(:name,
:id);

****Now the error*** :(

0006 insert into samples.saat3
(:name,
:id);

Number of recs/msgs: 3780
Starting to send to RDBMS with 1 record
Incorrect number of bytes returned from a File Read!
Expected: 12, Received:2

Could you help in sorting out this problem.
When i use the first record alone it is executing, but throwing error if two records present in the file.
4 REPLIES
Senior Apprentice

Re: Error while loading data using fastload utility

A newline in windows is actually two characters CR/LF.

Dieter
Enthusiast

Re: Error while loading data using fastload utility

Hi Dieter,
Thanks for your reply
Could you explain what should i change in my input data, so that i could load the two records into the table
Senior Apprentice

Re: Error while loading data using fastload utility

Just change the layout definition to match the actual size of 2 characters:

newlinechar(char(2))

Or change the input definition to SET RECORD TEXT and remove the newlinechar.

Dieter

Re: Error while loading data using fastload utility

Can't we preserve the newline character? Is there a way?