473,419 Members | 4,314 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,419 software developers and data experts.

Is LOAD really this brain damaged?

aj
DB2 WSUE LUW v8.2 FP4 (aka v8.1 FP11)
RHEL AS 4

I am EXPORTing in IXF format from one schema and then LOADing into
another schema on another server.

The DB modeling tool I am using likes to put the PK columns at the
very top of the CREATE TABLE ddl, so the ordering of the columns in
the FROM schema is sometimes different from the ordering in the TO schema.

I have discovered that:
1. If the ordering of the columns is different, I *must* use the
METHOD N (colx,coly,colz) clause on the LOAD. All the column names
are the same - why can't LOAD figure it out?

2. If the ordering of the columns is the same I *must not* use the
METHOD N (colx,coly,colz) clause on the LOAD. If I do, I'll get:
SQL3086N There was no source column specified to be loaded into
database column "0" or the specified source column does not exist,
but the database column is not nullable.

So if I'm specific about the column ordering when I really don't need
to be, the LOAD won't work? I can't be TOO specific??

Am I missing something? <scratching head>

aj

PS - Before you ask, I am using LOAD rather than IMPORT because I need
IDENTITYOVERRIDE.
Mar 23 '06 #1
10 3979
aj wrote:
DB2 WSUE LUW v8.2 FP4 (aka v8.1 FP11)
RHEL AS 4

I am EXPORTing in IXF format from one schema and then LOADing into
another schema on another server.

The DB modeling tool I am using likes to put the PK columns at the
very top of the CREATE TABLE ddl, so the ordering of the columns in
the FROM schema is sometimes different from the ordering in the TO schema.

I have discovered that:
1. If the ordering of the columns is different, I *must* use the
METHOD N (colx,coly,colz) clause on the LOAD. All the column names
are the same - why can't LOAD figure it out? I guess they want to be rather save than sorry...

2. If the ordering of the columns is the same I *must not* use the
METHOD N (colx,coly,colz) clause on the LOAD. If I do, I'll get:
SQL3086N There was no source column specified to be loaded into
database column "0" or the specified source column does not exist,
but the database column is not nullable.

It seems more like you're missing a column in your specification.
What is the signature of the target column and the source?

I think a complete repro scenario might be in order here.
Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Mar 23 '06 #2
aj
Thanks for the reply, Serge.

....snip..

Serge Rielau wrote:
2. If the ordering of the columns is the same I *must not* use the
METHOD N (colx,coly,colz) clause on the LOAD. If I do, I'll get:
SQL3086N There was no source column specified to be loaded into
database column "0" or the specified source column does not exist,
but the database column is not nullable.

It seems more like you're missing a column in your specification.
What is the signature of the target column and the source?


I don't think so. If I simply remove the METHOD N (colx,coly,colz)
clause on the LOAD where the column ordering matches, it works
**perfectly**.

aj
Mar 23 '06 #3
aj wrote:
Thanks for the reply, Serge.

...snip..

Serge Rielau wrote:
2. If the ordering of the columns is the same I *must not* use the
METHOD N (colx,coly,colz) clause on the LOAD. If I do, I'll get:
SQL3086N There was no source column specified to be loaded into
database column "0" or the specified source column does not exist,
but the database column is not nullable.

It seems more like you're missing a column in your specification.
What is the signature of the target column and the source?


I don't think so. If I simply remove the METHOD N (colx,coly,colz)
clause on the LOAD where the column ordering matches, it works
**perfectly**.

aj

So, could it be you have 4 columns instead of 3?

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Mar 23 '06 #4
aj
Serge Rielau wrote:
aj wrote:
Thanks for the reply, Serge.

...snip..

I don't think so. If I simply remove the METHOD N (colx,coly,colz)
clause on the LOAD where the column ordering matches, it works
**perfectly**.

aj

So, could it be you have 4 columns instead of 3?


No. The number, order, and names of the columns match exactly....

I was using (colx,coly,colz) just to be demonstrative. I actually
have as few as 2 columns in some tables and dozens in others..

aj
Mar 23 '06 #5
aj wrote:
DB2 WSUE LUW v8.2 FP4 (aka v8.1 FP11)
RHEL AS 4

I am EXPORTing in IXF format from one schema and then LOADing into
another schema on another server.

The DB modeling tool I am using likes to put the PK columns at the
very top of the CREATE TABLE ddl, so the ordering of the columns in
the FROM schema is sometimes different from the ordering in the TO schema.

I have discovered that:
1. If the ordering of the columns is different, I *must* use the
METHOD N (colx,coly,colz) clause on the LOAD. All the column names
are the same - why can't LOAD figure it out?
You are assuming that identical column names imply a match. I don't think
that you want to have this in the general case, do you? (At least it
should be controlled by _some_ option.)
2. If the ordering of the columns is the same I *must not* use the
METHOD N (colx,coly,colz) clause on the LOAD. If I do, I'll get:
SQL3086N There was no source column specified to be loaded into
database column "0" or the specified source column does not exist,
but the database column is not nullable.

So if I'm specific about the column ordering when I really don't need
to be, the LOAD won't work? I can't be TOO specific??


Works for me:

$ db2 "create table t1 ( a int, b int )"
$ db2 "insert into t1 values (1, 2)"
$ db2 "export to f of ixf select * from t1"
$ db2 "create table t2 like t1"
$ db2 "load from f of ixf insert into t2"

What is different in your scenario?

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Mar 23 '06 #6
aj
I took your example and added
MODIFIED BY ANYORDER METHOD N (a,b)
and it worked. Mine didn't act like that.

<scratching head>???

I'm doing something like:
LOAD FROM "tbl.ixf" OF IXF MODIFIED BY ANYORDER
IDENTITYOVERRIDE METHOD N (a,b) MESSAGES "tbl.in"
REPLACE INTO tbl NONRECOVERABLE INDEXING MODE AUTOSELECT

The IXF file is coming from a table residing in an 8.1
remote database that has been catalogued on my 8.2 server.
I wonder if that makes a difference...

Something else is going on here... I apologize for
assuming right away that LOAD was stupid...

Do you see anything obvious?

TIA
aj


Knut Stolze wrote:
aj wrote:
DB2 WSUE LUW v8.2 FP4 (aka v8.1 FP11)
RHEL AS 4

I am EXPORTing in IXF format from one schema and then LOADing into
another schema on another server.

The DB modeling tool I am using likes to put the PK columns at the
very top of the CREATE TABLE ddl, so the ordering of the columns in
the FROM schema is sometimes different from the ordering in the TO schema.

I have discovered that:
1. If the ordering of the columns is different, I *must* use the
METHOD N (colx,coly,colz) clause on the LOAD. All the column names
are the same - why can't LOAD figure it out?


You are assuming that identical column names imply a match. I don't think
that you want to have this in the general case, do you? (At least it
should be controlled by _some_ option.)
2. If the ordering of the columns is the same I *must not* use the
METHOD N (colx,coly,colz) clause on the LOAD. If I do, I'll get:
SQL3086N There was no source column specified to be loaded into
database column "0" or the specified source column does not exist,
but the database column is not nullable.

So if I'm specific about the column ordering when I really don't need
to be, the LOAD won't work? I can't be TOO specific??


Works for me:

$ db2 "create table t1 ( a int, b int )"
$ db2 "insert into t1 values (1, 2)"
$ db2 "export to f of ixf select * from t1"
$ db2 "create table t2 like t1"
$ db2 "load from f of ixf insert into t2"

What is different in your scenario?

Mar 23 '06 #7
Ian
aj wrote:
I took your example and added
MODIFIED BY ANYORDER METHOD N (a,b)
and it worked. Mine didn't act like that.

<scratching head>???

I'm doing something like:
LOAD FROM "tbl.ixf" OF IXF MODIFIED BY ANYORDER
IDENTITYOVERRIDE METHOD N (a,b) MESSAGES "tbl.in"
REPLACE INTO tbl NONRECOVERABLE INDEXING MODE AUTOSELECT

The IXF file is coming from a table residing in an 8.1
remote database that has been catalogued on my 8.2 server.
I wonder if that makes a difference...

You posted a similar question but it sounded like the columns
in your source database were in a different order than in the
target database. Is this no longer the case?

i.e. server1: tbl(a, b, c, d)
server2: tbl(c, d, b, a)
Ian
Mar 23 '06 #8
aj
In this particular case thats correct. I am LOADing a bunch of
tables. My modeling tool likes to put PK at top of CREATE TABLE
DDL. In some cases I had already done this, in others I had not.
So in some cases columns are same order, in others not.

Ian wrote:
You posted a similar question but it sounded like the columns
in your source database were in a different order than in the
target database. Is this no longer the case?

i.e. server1: tbl(a, b, c, d)
server2: tbl(c, d, b, a)
Ian


Mar 23 '06 #9
Ian
aj wrote:
Ian wrote:
You posted a similar question but it sounded like the columns
in your source database were in a different order than in the
target database. Is this no longer the case?

i.e. server1: tbl(a, b, c, d)
server2: tbl(c, d, b, a)
In this particular case thats correct. I am LOADing a bunch of
tables. My modeling tool likes to put PK at top of CREATE TABLE
DDL. In some cases I had already done this, in others I had not.
So in some cases columns are same order, in others not.

Well, then that's exactly the problem. If the columns in your data file
do not match the order in your database, then this is expected.

Why would you expect different? Because the IXF file includes
some information about the table you extracted from?

LOAD is meant to write data into the database FAST, and the tax you
pay for its speed is that you are required to supply the brains.
Note that, unlike IMPORT, LOAD can't create tables (i.e. IMPORT ...
CREATE INTO table).
Mar 24 '06 #10
aj
Forgive me - I don't think I explained myself well enough.

I EXPORTed a group of IXF files from an 8.1 DB, and then
tried to LOAD these IXF into empty tables in an
8.2 DB. In some cases, the column ordering was a bit
different, but I always had the same # of columns and
same names.

I though that, even tho the ordering was sometimes different,
if I had the same # of columns and same names, LOAD would be
able to figure things out. I was incorrect-it won't do that.
and thats fine.

So I went thru my script, and for *every* LOAD added a METHOD N
(col,col,col,..), specifying the order of the columns in the
empty tables I was LOADing into.

When I ran my script, LOAD worked for those empty tables that
had a different column ordering than the source tables.
LOAD *did not work* for those tables that had the same column
ordering as the source tables.

Just out of sheer frustration, I went back thru my script and
removed the METHOD N (col,col,..) for those tables that had the
same column ordering. I reran the script, and LOADs that failed
before worked fine.

So it looked to me like, if the column ordering was exactly the
same, you could not use METHOD N. And if the column ordering was
different, you must use METHOD N. Perhaps I am incorrect.

I am backtracking today and will figure out what is causing this.
I appreciate your assistance.

aj

Ian wrote:
aj wrote:
Ian wrote:
You posted a similar question but it sounded like the columns
in your source database were in a different order than in the
target database. Is this no longer the case?

i.e. server1: tbl(a, b, c, d)
server2: tbl(c, d, b, a)

> In this particular case thats correct. I am LOADing a bunch of
> tables. My modeling tool likes to put PK at top of CREATE TABLE
> DDL. In some cases I had already done this, in others I had not.
> So in some cases columns are same order, in others not.

Well, then that's exactly the problem. If the columns in your data file
do not match the order in your database, then this is expected.

Why would you expect different? Because the IXF file includes
some information about the table you extracted from?

LOAD is meant to write data into the database FAST, and the tax you
pay for its speed is that you are required to supply the brains.
Note that, unlike IMPORT, LOAD can't create tables (i.e. IMPORT ...
CREATE INTO table).

Mar 24 '06 #11

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

Similar topics

1
by: Dagoberto | last post by:
can somebody tell me how can I get old data from a recently damaged table?
2
by: Raquel | last post by:
On Linux, suppose a recoverable database has crashed due to a damaged tablespace (the container on which the tablespace existed has gone bad). On restarting the database, I understand that the...
2
by: XXX | last post by:
Hi, I've got a problem with a damaged access 2000 database. When I try to repair and compact the database, the process starts normaly, but then (after appr. 50 %) it hangs. Neither is it...
0
by: maniac | last post by:
Gang: "There was an error opening this document. The file is damaged and could not be repaired." Has anybody had issue with not being able to open pdf in any browser using ..net application?...
1
by: lauralucas | last post by:
I'm starting to suspect something is damaged in my working environment. (asp.net 1.1 and visual studio 2003) for example: is this normal? I add a label I assign the label a value of "hello" in...
1
by: MrWriteLA | last post by:
I've been trying to code a fairly uncomplicated program that will read some values from an Excel worksheet into Illustrator variables. I tried VBA first, being careful to add the Illustrator...
10
by: sara | last post by:
Hi - I have been struggling with solution ideas for this now for almost 2 weeks, and have not been able to figure this out. I have a user who creates a Purchase Order (tblPOData). In some...
3
by: olle | last post by:
How to deal with a VBA-project that is damaged? Hi everyone. I am BigOlle from sweden and I have been working with Accees for ten years I am now working on a project that started in Access97...
4
hemantbasva
by: hemantbasva | last post by:
We have designed an aspx page having five ajax tab in it. the data of first four are designed on page whereas for the fifth tab it renders a user control named MYDOMAIN. in the tab container's even...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.