Page 1 of 1

Some lines of data missing when inserting into DB2

Posted: Fri Oct 28, 2011 1:20 am
by kanasai167
My textfile got around 140,000 lines.
It is a fixed length file where i retrieve from a mainframe.
I put it under a Sequential file with format :
Record delimiter = UNIX newline
Delimiter = None

However , after i run the job , the result over the DSLink shows only 125,000 rows , 3800 rows/sec.
Is this mean only 125,000 lines of data being insert into my db2 ?
(by the way im new to db2 , how can i know total of rows of the table in db2?)
The 15,000 lines is being rejected when insert into db2 for what reason?

Thanks

Re: Some lines of data missing when inserting into DB2

Posted: Fri Oct 28, 2011 1:44 am
by MT
Hi kanasai167

getting the number of rows in a able is a simple SQL statement:
select count(*) from <schemaname>.<tabname>

Rows can get rejected if there is a unique contraint on the table or something similar.

Contact your DBA for further details

Posted: Fri Oct 28, 2011 2:18 am
by kanasai167
thanks for the help on the count of rows.

im creating a new table to store the data from a fixed length textfile.
Im using the DB2 UDB API to insert the data into db2 by turning on the generate DDL to create table.

How should i remove the unique contraint ? Is it on the source(textfile) or the destination(db2 table) ?

Posted: Fri Oct 28, 2011 3:46 am
by suse_dk
Do you define a primary key for your table? If yes, then you have a unique contraint.

But are you sure that you read ALL 140.000 records from the source succesfully?

What is the record count from the source output link? Try to put a reject link on the sequential file stage and catch for catching any reject due to format issues.

For your target stage then I don't know if it supports reject links, but if it does then add a reject link here as well.

Posted: Sun Oct 30, 2011 8:52 pm
by kanasai167
no , i didnt define anything in the new table.
I already put a reject link , i found out that some of the data the last column are blank. So i believe the record delimiter is stored at the second last column ? So it is rejected?