473,402 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Bug in LOAD command?

JS
EE instance DB2 v7.2.0 fixpack 3 on WIN2K.
I select some data from a table A and write it to a file using the COALESCE
function and whitespace as the null character:
eg coalesce(col1, ' '). This column has 10,000 nulls in table A.
Select count(*) from table A where col1 is null=10,000
Using the load utlity, I load the data file as follows into table B which
has not null constraint on col1:
LOAD FROM LOAD.TEST OF ASC
MODIFIED BY STRIPTBLANKS NULLINDCHAR=X20
METHOD L (1 11)
ROWCOUNT 2000000
MESSAGES LOAD.REPORT
REPLACE INTO TABLE2
FOR EXCEPTION TABLEX2
STATISTICS YES WITH DISTRIBUTION AND DETAILED INDEXES ALL
The load only generates 9,954 exceptions. Would like to understand why.
Thank you
Nov 12 '05 #1
6 4291

"JS" <fy***@hotmail.com> wrote in message
news:e9**************************@posting.google.c om...
EE instance DB2 v7.2.0 fixpack 3 on WIN2K.
I select some data from a table A and write it to a file using the COALESCE function and whitespace as the null character:
eg coalesce(col1, ' '). This column has 10,000 nulls in table A.
Select count(*) from table A where col1 is null=10,000
Using the load utlity, I load the data file as follows into table B which
has not null constraint on col1:
LOAD FROM LOAD.TEST OF ASC
MODIFIED BY STRIPTBLANKS NULLINDCHAR=X20
METHOD L (1 11)
ROWCOUNT 2000000
MESSAGES LOAD.REPORT
REPLACE INTO TABLE2
FOR EXCEPTION TABLEX2
STATISTICS YES WITH DISTRIBUTION AND DETAILED INDEXES ALL
The load only generates 9,954 exceptions. Would like to understand why.
I'm not clear on what you're trying to do, mostly because you haven't fully
described tables A and B, specifically what columns are in each and how
those columns are defined.

It *sounds* like you're saying that you are only selecting one column, col1,
from Table A and are trying to load it into a Table B which also has only 1
column. Is that right? If so, what is the difference between Table A and
Table B in the first place; if they are the same table, why copy from one to
another?

Also, this: Select count(*) from table A where col1 is null=10,000 is definitely going to be a problem. The expression count(*) is going to
return a single number, the number of rows in Table A that satisfy the where
clause. The where clause doesn't make sense though: do you want the rows
where col1 is null or the rows where col1 = 10000? I suspect you really want
to copy over *all* of the rows, (not the NUMBER of rows), so that you don't
want that count(*) expression at all and you don't want the where clause
either. But I'm really not sure.

I don't understand this remark at all: The load only generates 9,954 exceptions. Would like to understand why.

By saying "only", it sounds like you are complaining because you wanted
*more* exceptions. Most people would be trying to find out how to get the
number of exceptions down to 0 to show that all of their data got
transferred over successfully.

Again, I'm really not sure what you're trying to do. Perhaps if you could
explain that in a bit more detail, someone could help you accomplish that.

Rhino
Nov 12 '05 #2
JS
"Rhino" <rh****@NOSPAM.sympatico.ca> wrote in message news:<gL*********************@news20.bellglobal.co m>...
"JS" <fy***@hotmail.com> wrote in message
news:e9**************************@posting.google.c om...
EE instance DB2 v7.2.0 fixpack 3 on WIN2K.
I select some data from a table A and write it to a file using the

COALESCE
function and whitespace as the null character:
eg coalesce(col1, ' '). This column has 10,000 nulls in table A.
Select count(*) from table A where col1 is null=10,000
Using the load utlity, I load the data file as follows into table B which
has not null constraint on col1:
LOAD FROM LOAD.TEST OF ASC
MODIFIED BY STRIPTBLANKS NULLINDCHAR=X20
METHOD L (1 11)
ROWCOUNT 2000000
MESSAGES LOAD.REPORT
REPLACE INTO TABLE2
FOR EXCEPTION TABLEX2
STATISTICS YES WITH DISTRIBUTION AND DETAILED INDEXES ALL
The load only generates 9,954 exceptions. Would like to understand why.


I'm not clear on what you're trying to do, mostly because you haven't fully
described tables A and B, specifically what columns are in each and how
those columns are defined.

It *sounds* like you're saying that you are only selecting one column, col1,
from Table A and are trying to load it into a Table B which also has only 1
column. Is that right? If so, what is the difference between Table A and
Table B in the first place; if they are the same table, why copy from one to
another?

Also, this:
Select count(*) from table A where col1 is null=10,000

is definitely going to be a problem. The expression count(*) is going to
return a single number, the number of rows in Table A that satisfy the where
clause. The where clause doesn't make sense though: do you want the rows
where col1 is null or the rows where col1 = 10000? I suspect you really want
to copy over *all* of the rows, (not the NUMBER of rows), so that you don't
want that count(*) expression at all and you don't want the where clause
either. But I'm really not sure.

I don't understand this remark at all:
The load only generates 9,954 exceptions. Would like to understand why.

By saying "only", it sounds like you are complaining because you wanted
*more* exceptions. Most people would be trying to find out how to get the
number of exceptions down to 0 to show that all of their data got
transferred over successfully.

Again, I'm really not sure what you're trying to do. Perhaps if you could
explain that in a bit more detail, someone could help you accomplish that.

Rhino


Perhaps badly explained, load command should have read:
LOAD FROM LOAD.TEST OF ASC
MODIFIED BY STRIPTBLANKS NULLINDCHAR=X20
METHOD L (1 11)
>>>>>>>NULL INDICATORS (0)<<<<<<<<<<<<<<<<

ROWCOUNT 2000000
MESSAGES LOAD.REPORT
REPLACE INTO TABLE2
FOR EXCEPTION TABLEX2
STATISTICS YES WITH DISTRIBUTION AND DETAILED INDEXES ALL

Select count(*) from table A where col1 is null
Result=10,000
This means the result of the sql statement is 10,000, that is 10,000
rows in table A have null values for col1

Doesnt matter what the difference is between the two columns as long
as the two tables have the same structure, the point is once the load
is completed, I should get 10,000 exceptions in the exception table,
instead I get only 9,954.
Nov 12 '05 #3

"JS" <fy***@hotmail.com> wrote in message
news:e9**************************@posting.google.c om...
"Rhino" <rh****@NOSPAM.sympatico.ca> wrote in message news:<gL*********************@news20.bellglobal.co m>...
"JS" <fy***@hotmail.com> wrote in message
news:e9**************************@posting.google.c om...
EE instance DB2 v7.2.0 fixpack 3 on WIN2K.
I select some data from a table A and write it to a file using the

COALESCE
function and whitespace as the null character:
eg coalesce(col1, ' '). This column has 10,000 nulls in table A.
Select count(*) from table A where col1 is null=10,000
Using the load utlity, I load the data file as follows into table B which has not null constraint on col1:
LOAD FROM LOAD.TEST OF ASC
MODIFIED BY STRIPTBLANKS NULLINDCHAR=X20
METHOD L (1 11)
ROWCOUNT 2000000
MESSAGES LOAD.REPORT
REPLACE INTO TABLE2
FOR EXCEPTION TABLEX2
STATISTICS YES WITH DISTRIBUTION AND DETAILED INDEXES ALL
The load only generates 9,954 exceptions. Would like to understand
why.

I'm not clear on what you're trying to do, mostly because you haven't fully described tables A and B, specifically what columns are in each and how
those columns are defined.

It *sounds* like you're saying that you are only selecting one column, col1, from Table A and are trying to load it into a Table B which also has only 1 column. Is that right? If so, what is the difference between Table A and
Table B in the first place; if they are the same table, why copy from one to another?

Also, this:
Select count(*) from table A where col1 is null=10,000

is definitely going to be a problem. The expression count(*) is going to
return a single number, the number of rows in Table A that satisfy the where clause. The where clause doesn't make sense though: do you want the rows
where col1 is null or the rows where col1 = 10000? I suspect you really want to copy over *all* of the rows, (not the NUMBER of rows), so that you don't want that count(*) expression at all and you don't want the where clause
either. But I'm really not sure.

I don't understand this remark at all:
The load only generates 9,954 exceptions. Would like to understand
why. By saying "only", it sounds like you are complaining because you wanted
*more* exceptions. Most people would be trying to find out how to get the number of exceptions down to 0 to show that all of their data got
transferred over successfully.

Again, I'm really not sure what you're trying to do. Perhaps if you could explain that in a bit more detail, someone could help you accomplish that.
Rhino


Perhaps badly explained, load command should have read:
LOAD FROM LOAD.TEST OF ASC
MODIFIED BY STRIPTBLANKS NULLINDCHAR=X20
METHOD L (1 11)>>>>>>>>NULL INDICATORS (0)<<<<<<<<<<<<<<<<

ROWCOUNT 2000000
MESSAGES LOAD.REPORT
REPLACE INTO TABLE2
FOR EXCEPTION TABLEX2
STATISTICS YES WITH DISTRIBUTION AND DETAILED INDEXES ALL

Select count(*) from table A where col1 is null
Result=10,000
This means the result of the sql statement is 10,000, that is 10,000
rows in table A have null values for col1

Okay, I get this part now.
Doesnt matter what the difference is between the two columns as long
as the two tables have the same structure, the point is once the load
is completed, I should get 10,000 exceptions in the exception table,
instead I get only 9,954.


Well, perhaps it shouldn't matter, in theory, how the tables look but it's
easier to debug a problem if you understand what the other guy is doing. If
you want to tie our hands behind our backs, it may hurt the quality of the
answer you get ;-)

Frankly, I'm still scratching my head because what you're describing doesn't
seem to add up. On one hand, I'm getting the impression that LOAD.TEST
contains 10,000 lines/rows, each containing a single blank. (I'm assuming
that col1 is a char/varchar column because all the arguments in the COALESCE
function need to be the same class of data, e.g. character, numeric, etc.
The second argument is a char so the first must also be. The result of
coalesce(null, '') is ''.) The LOAD statement says you are only reading one
column from LOAD.TEST. But this doesn't make a lot of sense to me since you
need a key to tell LOAD which row of Table B it is being replaced by each
row of LOAD.TEST. (If all of the values in LOAD.TEST are blank, they are
obviously not primary key values.) You are also telling the LOAD statement
that you have 2 million rows, not 10,000.
If you can clarify that, maybe I can suggest a solution to your problem. If
not, maybe someone else can make sense of what you're trying to do.

Rhino
Nov 12 '05 #4
JS
LOAD FROM LOAD.TEST OF ASC
MODIFIED BY STRIPTBLANKS NULLINDCHAR=X20
METHOD L (1 11)
NULL INDICATORS (0)
ROWCOUNT 2000000
MESSAGES LOAD.REPORT
REPLACE INTO TABLE2
FOR EXCEPTION TABLEX2
STATISTICS YES WITH DISTRIBUTION AND DETAILED INDEXES ALL

Ok, its like this:
TABLE A has 10,000,000 rows, I only want to load the first 2,000,000.
Among these 2 million rows, 10,000 of them have space
(NULLINDCHAR=X20) or null values.
If the column value is less than varchar(20), I want the load to strip
the
blanks when replacing in TABLE B.
NULL INDICATORS (0) means that the col1 in TABLE B cannot accept null
values, therefore the load utility should reject any row that has null
as it value.
The original question still remains:
Why does the load utility reject less than 10,000 rows?
Nov 12 '05 #5

"JS" <fy***@hotmail.com> wrote in message
news:e9**************************@posting.google.c om...
LOAD FROM LOAD.TEST OF ASC
MODIFIED BY STRIPTBLANKS NULLINDCHAR=X20
METHOD L (1 11)
NULL INDICATORS (0)
ROWCOUNT 2000000
MESSAGES LOAD.REPORT
REPLACE INTO TABLE2
FOR EXCEPTION TABLEX2
STATISTICS YES WITH DISTRIBUTION AND DETAILED INDEXES ALL

Ok, its like this:
TABLE A has 10,000,000 rows, I only want to load the first 2,000,000.
Among these 2 million rows, 10,000 of them have space
(NULLINDCHAR=X20) or null values.
If the column value is less than varchar(20), I want the load to strip
the
blanks when replacing in TABLE B.
NULL INDICATORS (0) means that the col1 in TABLE B cannot accept null
values, therefore the load utility should reject any row that has null
as it value.
The original question still remains:
Why does the load utility reject less than 10,000 rows?


Okay, that helps - somewhat. If I understand you, you really only want to
load the 1,990,000 rows (2 million minus 10,000) that don't have a blank in
columns 1-11 of LOAD.TEST but you are actually loading 1,990,046 records and
want to know why your technique is failing to exclude those extra 46
records.

It seems very likely that those extra 46 rows actually have values that you
aren't expecting. As an experiment, put only the 10,000 rows in LOAD.TEST
and see if they all get excluded or if some of them slip through. If some
slip through, read LOAD.TEST in a hex editor and see if you can find any
values that aren't what you're expecting. I expect that the values in Table
A aren't quite what you think they are and therefore the values in LOAD.TEST
aren't quite what you're expecting either.

If all 10,000 records get excluded, I'm not sure what to suggest but you've
probably eliminated the possibility that LOAD has a bug....

Rhino
Nov 12 '05 #6
JS
"Rhino" <rh****@NOSPAM.sympatico.ca> wrote in message news:<J%*******************@news20.bellglobal.com> ...
"JS" <fy***@hotmail.com> wrote in message
news:e9**************************@posting.google.c om...
LOAD FROM LOAD.TEST OF ASC
MODIFIED BY STRIPTBLANKS NULLINDCHAR=X20
METHOD L (1 11)
NULL INDICATORS (0)
ROWCOUNT 2000000
MESSAGES LOAD.REPORT
REPLACE INTO TABLE2
FOR EXCEPTION TABLEX2
STATISTICS YES WITH DISTRIBUTION AND DETAILED INDEXES ALL

Ok, its like this:
TABLE A has 10,000,000 rows, I only want to load the first 2,000,000.
Among these 2 million rows, 10,000 of them have space
(NULLINDCHAR=X20) or null values.
If the column value is less than varchar(20), I want the load to strip
the
blanks when replacing in TABLE B.
NULL INDICATORS (0) means that the col1 in TABLE B cannot accept null
values, therefore the load utility should reject any row that has null
as it value.
The original question still remains:
Why does the load utility reject less than 10,000 rows?


Okay, that helps - somewhat. If I understand you, you really only want to
load the 1,990,000 rows (2 million minus 10,000) that don't have a blank in
columns 1-11 of LOAD.TEST but you are actually loading 1,990,046 records and
want to know why your technique is failing to exclude those extra 46
records.

It seems very likely that those extra 46 rows actually have values that you
aren't expecting. As an experiment, put only the 10,000 rows in LOAD.TEST
and see if they all get excluded or if some of them slip through. If some
slip through, read LOAD.TEST in a hex editor and see if you can find any
values that aren't what you're expecting. I expect that the values in Table
A aren't quite what you think they are and therefore the values in LOAD.TEST
aren't quite what you're expecting either.

If all 10,000 records get excluded, I'm not sure what to suggest but you've
probably eliminated the possibility that LOAD has a bug....

Rhino


NULL INDICATORS (0)
changed it to NULL INDICATORS (1), now it works, thanks anyways, still
Im at a loss to explain why it should work this way
Nov 12 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Donald Tyler | last post by:
Then the only way you can do it that I can think of is to write a PHP script to do basically what PHPMyAdmin is trying to do but without the LOCAL in there. However to do that you would need to...
1
by: R. Clausen | last post by:
During the night we replicate multiple tables from a production database to a test database. Due to a server disk space full condition occurring while replication was running, a tablespace was...
3
by: Arti Potnis | last post by:
Hi, I am trying to execute the DB2 load utility from a C program. lPid = fork(); execl(csExePath, csExeName,csCmd, NULL); the contents of the parameter variables are as follows:-
7
by: DB_2 | last post by:
Hello, I was trying to load a comma-separated text file to a DB2 table. I believe I have the syntax rigt for the LOAD command. My first question is, how do you actually run it? It is not a...
3
by: claus.hirth | last post by:
When I execute the following statment using the Command Center it works: LOAD CLIENT FROM 'Y:\\TheFixedWidthData.txt' OF ASC METHOD L ( 1 1,2 11,12 17) REPLACE INTO S00.TheTargetTable...
3
by: nsh | last post by:
mailing.database.mysql, comp.lang.php subject: does "LOAD DATA" EVER work?!? I've tried EVERYTHING! version info: my isp is running my web page on a linux box with php ver. 4.4.1 according to...
1
by: huyuhui | last post by:
The following is a question of LOAD utility. Question: How does the DB2 enforce table check constraints for data added to table with the LOAD utility? A. With the BUILD phase of LOAD B. With the...
1
by: Justin | last post by:
We had a load that failed. Now we have a pending load. When executing load terminate, we receive the following error: db2 load terminate SQL0104N An unexpected token "terminate" was found...
2
by: mike.lopiano | last post by:
There is a significant gap (~ 3.5 minutes) in the time our LOAD command indicates that the BUILD phase is complete and the time we have control returned to our script. I ran the test below on a...
5
by: danfan46 | last post by:
Hi. I'm on DB2 9.5.0.1 on Linux AMD 64 and the database has four partitions where catalog is on partion 0 and user data on 1 thru 3. After a load failure (path to load file was wrong) I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.