help load data using import utility

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • davvid@libero.it

    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,ide ntity column generated always), att_r1,...)
    table leaf (Id_leaf(pk,ide ntity 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

    #2
    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.i t wrote:
    [color=blue]
    > 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,ide ntity column generated always), att_r1,...)
    > table leaf (Id_leaf(pk,ide ntity 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[/color]

    --
    Anton Versteeg
    IBM Certified DB2 Specialist
    IBM Netherlands

    Comment

    • Anton Versteeg

      #3
      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.i t wrote:
      [color=blue]
      > 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,ide ntity column generated always), att_r1,...)
      > table leaf (Id_leaf(pk,ide ntity 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[/color]

      --
      Anton Versteeg
      IBM Certified DB2 Specialist
      IBM Netherlands

      Comment

      • davvid@libero.it

        #4
        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$4n 1c$1@sp15en20.h ursley.ibm.com> ...[color=blue]
        > 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.i t wrote:
        >[color=green]
        > > 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,ide ntity column generated always), att_r1,...)
        > > table leaf (Id_leaf(pk,ide ntity 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[/color][/color]

        Comment

        • davvid@libero.it

          #5
          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$4n 1c$1@sp15en20.h ursley.ibm.com> ...[color=blue]
          > 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.i t wrote:
          >[color=green]
          > > 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,ide ntity column generated always), att_r1,...)
          > > table leaf (Id_leaf(pk,ide ntity 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[/color][/color]

          Comment

          • Anton Versteeg

            #6
            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.i t wrote:[color=blue]
            > 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$4n 1c$1@sp15en20.h ursley.ibm.com> ...
            >[color=green]
            >>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:
            >>
            >>[color=darkred]
            >>>hello,
            >>>please I would like to know if it's possible to load data in
            >>>hierarchic al table structure with identity column used as pk (for all
            >>>the tables) :
            >>>I mean
            >>>
            >>>table root (Id_root(pk,ide ntity column generated always), att_r1,...)
            >>>table leaf (Id_leaf(pk,ide ntity 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[/color][/color][/color]

            --
            Anton Versteeg
            IBM Certified DB2 Specialist
            IBM Netherlands

            Comment

            • Anton Versteeg

              #7
              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.i t wrote:[color=blue]
              > 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$4n 1c$1@sp15en20.h ursley.ibm.com> ...
              >[color=green]
              >>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:
              >>
              >>[color=darkred]
              >>>hello,
              >>>please I would like to know if it's possible to load data in
              >>>hierarchic al table structure with identity column used as pk (for all
              >>>the tables) :
              >>>I mean
              >>>
              >>>table root (Id_root(pk,ide ntity column generated always), att_r1,...)
              >>>table leaf (Id_leaf(pk,ide ntity 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[/color][/color][/color]

              --
              Anton Versteeg
              IBM Certified DB2 Specialist
              IBM Netherlands

              Comment

              Working...