By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,919 Members | 1,047 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,919 IT Pros & Developers. It's quick & easy.

help load data using import utility

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.