468,272 Members | 2,025 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,272 developers. It's quick & easy.

help load data using import utility

hello,
please I would like to know if it's possible to load data in
hierarchical table structure with identity column used as pk (for all
the tables) :
I mean

table root (Id_root(pk,identity column generated always), att_r1,...)
table leaf (Id_leaf(pk,identity column generated always), id_root(fk
ref root), att_l1 ...)

could I use import to populate both root and leaf table avoiding an
insert select insert loop ?

many tanks in advance
best regard David
Nov 12 '05 #1
6 3079
If you reset the identity in all the tables and if you are doing a load
with replace then you might end up with the same identity values
everywhere but only if there are no rejects.

da****@libero.it wrote:
hello,
please I would like to know if it's possible to load data in
hierarchical table structure with identity column used as pk (for all
the tables) :
I mean

table root (Id_root(pk,identity column generated always), att_r1,...)
table leaf (Id_leaf(pk,identity column generated always), id_root(fk
ref root), att_l1 ...)

could I use import to populate both root and leaf table avoiding an
insert select insert loop ?

many tanks in advance
best regard David


--
Anton Versteeg
IBM Certified DB2 Specialist
IBM Netherlands

Nov 12 '05 #2
If you reset the identity in all the tables and if you are doing a load
with replace then you might end up with the same identity values
everywhere but only if there are no rejects.

da****@libero.it wrote:
hello,
please I would like to know if it's possible to load data in
hierarchical table structure with identity column used as pk (for all
the tables) :
I mean

table root (Id_root(pk,identity column generated always), att_r1,...)
table leaf (Id_leaf(pk,identity column generated always), id_root(fk
ref root), att_l1 ...)

could I use import to populate both root and leaf table avoiding an
insert select insert loop ?

many tanks in advance
best regard David


--
Anton Versteeg
IBM Certified DB2 Specialist
IBM Netherlands

Nov 12 '05 #3
thank you Anton but I didn't understand:
once the root table has been loaded how is possible the leaf table
knows every row's correct id_root to be loaded?

I'dont think is possible use the load utility.
I've read about using import to accomplish that. dont know how.

Anton Versteeg <an************@nnll.ibm.com> wrote in message news:<c7***********@sp15en20.hursley.ibm.com>...
If you reset the identity in all the tables and if you are doing a load
with replace then you might end up with the same identity values
everywhere but only if there are no rejects.

da****@libero.it wrote:
hello,
please I would like to know if it's possible to load data in
hierarchical table structure with identity column used as pk (for all
the tables) :
I mean

table root (Id_root(pk,identity column generated always), att_r1,...)
table leaf (Id_leaf(pk,identity column generated always), id_root(fk
ref root), att_l1 ...)

could I use import to populate both root and leaf table avoiding an
insert select insert loop ?

many tanks in advance
best regard David

Nov 12 '05 #4
thank you Anton but I didn't understand:
once the root table has been loaded how is possible the leaf table
knows every row's correct id_root to be loaded?

I'dont think is possible use the load utility.
I've read about using import to accomplish that. dont know how.

Anton Versteeg <an************@nnll.ibm.com> wrote in message news:<c7***********@sp15en20.hursley.ibm.com>...
If you reset the identity in all the tables and if you are doing a load
with replace then you might end up with the same identity values
everywhere but only if there are no rejects.

da****@libero.it wrote:
hello,
please I would like to know if it's possible to load data in
hierarchical table structure with identity column used as pk (for all
the tables) :
I mean

table root (Id_root(pk,identity column generated always), att_r1,...)
table leaf (Id_leaf(pk,identity column generated always), id_root(fk
ref root), att_l1 ...)

could I use import to populate both root and leaf table avoiding an
insert select insert loop ?

many tanks in advance
best regard David

Nov 12 '05 #5
Apparantly you have established some link between the tables.
I assumed it was the physical sequence of the load/import files.
If that is not the case then you should probably consider using
'generated by default' in stead.
In that case the identity values can be part of the load/import file.

da****@libero.it wrote:
thank you Anton but I didn't understand:
once the root table has been loaded how is possible the leaf table
knows every row's correct id_root to be loaded?

I'dont think is possible use the load utility.
I've read about using import to accomplish that. dont know how.

Anton Versteeg <an************@nnll.ibm.com> wrote in message news:<c7***********@sp15en20.hursley.ibm.com>...
If you reset the identity in all the tables and if you are doing a load
with replace then you might end up with the same identity values
everywhere but only if there are no rejects.

da****@libero.it wrote:

hello,
please I would like to know if it's possible to load data in
hierarchical table structure with identity column used as pk (for all
the tables) :
I mean

table root (Id_root(pk,identity column generated always), att_r1,...)
table leaf (Id_leaf(pk,identity column generated always), id_root(fk
ref root), att_l1 ...)

could I use import to populate both root and leaf table avoiding an
insert select insert loop ?

many tanks in advance
best regard David


--
Anton Versteeg
IBM Certified DB2 Specialist
IBM Netherlands

Nov 12 '05 #6
Apparantly you have established some link between the tables.
I assumed it was the physical sequence of the load/import files.
If that is not the case then you should probably consider using
'generated by default' in stead.
In that case the identity values can be part of the load/import file.

da****@libero.it wrote:
thank you Anton but I didn't understand:
once the root table has been loaded how is possible the leaf table
knows every row's correct id_root to be loaded?

I'dont think is possible use the load utility.
I've read about using import to accomplish that. dont know how.

Anton Versteeg <an************@nnll.ibm.com> wrote in message news:<c7***********@sp15en20.hursley.ibm.com>...
If you reset the identity in all the tables and if you are doing a load
with replace then you might end up with the same identity values
everywhere but only if there are no rejects.

da****@libero.it wrote:

hello,
please I would like to know if it's possible to load data in
hierarchical table structure with identity column used as pk (for all
the tables) :
I mean

table root (Id_root(pk,identity column generated always), att_r1,...)
table leaf (Id_leaf(pk,identity column generated always), id_root(fk
ref root), att_l1 ...)

could I use import to populate both root and leaf table avoiding an
insert select insert loop ?

many tanks in advance
best regard David


--
Anton Versteeg
IBM Certified DB2 Specialist
IBM Netherlands

Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Thames | last post: by
1 post views Thread by Rahul | last post: by
1 post views Thread by huyuhui | last post: by
7 posts views Thread by Gregor =?UTF-8?B?S292YcSN?= | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.