Unix Technical Forum

help load data using import utility

This is a discussion on help load data using import utility within the DB2 forums, part of the Database Server Software category; --> hello, please I would like to know if it's possible to load data in hierarchical table structure with identity ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-26-2008, 06:56 PM
davvid@libero.it
 
Posts: n/a
Default 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-26-2008, 06:56 PM
Anton Versteeg
 
Posts: n/a
Default Re: help load data using import utility

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.

davvid@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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-26-2008, 06:58 PM
davvid@libero.it
 
Posts: n/a
Default Re: help load data using import utility

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 <anton_versteeg@nnll.ibm.com> wrote in message news:<c7dj9h$4n1c$1@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.
>
> davvid@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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-26-2008, 06:59 PM
Anton Versteeg
 
Posts: n/a
Default Re: help load data using import utility

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.

davvid@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 <anton_versteeg@nnll.ibm.com> wrote in message news:<c7dj9h$4n1c$1@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.
>>
>>davvid@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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:04 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com