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 6 3186
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
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
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
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
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
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 This discussion thread is closed Replies have been disabled for this discussion. Similar topics
7 posts
views
Thread by Eric.Jones |
last post: by
|
2 posts
views
Thread by Thames |
last post: by
|
1 post
views
Thread by Rahul |
last post: by
|
3 posts
views
Thread by cpressley2 |
last post: by
|
5 posts
views
Thread by Konstantin Andreev |
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
|
16 posts
views
Thread by ARC |
last post: by
| | | | | | | | | | | |