Loading ...
Sorry, an error occurred while loading the content.

Re: Mapping Question

Expand Messages
  • sharadaj2000
    Hi, i solved the problem using inline mapping as u said.that works.thanks. few more qs. is there a possibility to retreive the value from the sequence anad
    Message 1 of 13 , Nov 19, 2002
    • 0 Attachment
      Hi,
      i solved the problem using inline mapping as u said.that
      works.thanks.
      few more qs.
      is there a possibility to retreive the value from the sequence anad
      insert into one of the columns defined as class.(all this i want to
      do in a map).If so,could u please direct me how to do this.

      <SUloop id = "111111">
      <N1 f0="SU"/>
      </SUloop>

      now i mapped this SUloop to a table named party.I want to insert this
      whole information(including id) into party table and also the id into
      another table like into supplierpartyid field of orderheader table
      (which is defined as a seperate class).
      can i do something like this.
      thank u so much for answering all my previous Qs
      thanks
      sharada.
    • Ronald Bourret
      ... By value from the sequence , do you mean the number of the order in which the element appears in its parent? For example:
      Message 2 of 13 , Nov 20, 2002
      • 0 Attachment
        sharadaj2000 wrote:

        > is there a possibility to retreive the value from the sequence anad
        > insert into one of the columns defined as class.(all this i want to
        > do in a map).If so,could u please direct me how to do this.

        By "value from the sequence", do you mean the number of the order in
        which the element appears in its parent? For example:

        <A>
        <B /> <!-- order number 1 -->
        <B /> <!-- order number 2 -->
        <B /> <!-- order number 3 -->
        </A>

        If so, this can be done using order columns. Properties, inlined
        elements, and related classes can have order columns. For more
        information, see the xmldbms2.dtd.

        > <SUloop id = "111111">
        > <N1 f0="SU"/>
        > </SUloop>
        >
        > now i mapped this SUloop to a table named party.I want to insert this
        > whole information(including id) into party table and also the id into
        > another table like into supplierpartyid field of orderheader table
        > (which is defined as a seperate class).

        If the id is used as the key used to join the party and orderheader
        tables, and the corresponding elements are parent and child, then this
        is done automatically. For example, suppose my XML was:

        <orderheader>
        <foo>...</foo>
        <bar>...</bar>
        <SUloop id = "111111">
        <N1 f0="SU"/>
        </SUloop>
        </orderheader>

        and that SUloop was defined as a related class of orderheader, with the
        value of the id attribute used as the key. In this case, XML-DBMS places
        the value of the id attribute in the orderheader and party tables.

        Except in the case described above, this is not supported.

        -- Ron

        -- Ron
        > can i do something like this.
        > thank u so much for answering all my previous Qs
        > thanks
        > sharada.
        >
        >
        > To post a message, send it to: xml-dbms@yahoogroups.com
        > To unsubscribe, send a blank message to: xml-dbms-unsubscribe@yahoogroups.com
        > Or join the newsgroup at: news://news.barkto.com/homeless.xml.xml-dbms
        >
        > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

        --
        Ronald Bourret
        Programming, Writing, and Research
        XML, Databases, and Schemas
        http://www.rpbourret.com
      • sharadaj2000
        Hi, I sequence means its oracle sequence for generating the autonumber. is there a possibility to read the value from a sequence and write to the primary key.
        Message 3 of 13 , Nov 21, 2002
        • 0 Attachment
          Hi,
          I sequence means its oracle sequence for generating the autonumber.
          is there a possibility to read the value from a sequence and write
          to the primary key.
          thanks
          sharada.

          --- In xml-dbms@y..., Ronald Bourret <rpbourret@r...> wrote:
          > sharadaj2000 wrote:
          >
          > > is there a possibility to retreive the value from the sequence
          anad
          > > insert into one of the columns defined as class.(all this i want
          to
          > > do in a map).If so,could u please direct me how to do this.
          >
          > By "value from the sequence", do you mean the number of the order in
          > which the element appears in its parent? For example:
          >
          > <A>
          > <B /> <!-- order number 1 -->
          > <B /> <!-- order number 2 -->
          > <B /> <!-- order number 3 -->
          > </A>
          >
          > If so, this can be done using order columns. Properties, inlined
          > elements, and related classes can have order columns. For more
          > information, see the xmldbms2.dtd.
          >
          > > <SUloop id = "111111">
          > > <N1 f0="SU"/>
          > > </SUloop>
          > >
          > > now i mapped this SUloop to a table named party.I want to insert
          this
          > > whole information(including id) into party table and also the id
          into
          > > another table like into supplierpartyid field of orderheader table
          > > (which is defined as a seperate class).
          >
          > If the id is used as the key used to join the party and orderheader
          > tables, and the corresponding elements are parent and child, then
          this
          > is done automatically. For example, suppose my XML was:
          >
          > <orderheader>
          > <foo>...</foo>
          > <bar>...</bar>
          > <SUloop id = "111111">
          > <N1 f0="SU"/>
          > </SUloop>
          > </orderheader>
          >
          > and that SUloop was defined as a related class of orderheader, with
          the
          > value of the id attribute used as the key. In this case, XML-DBMS
          places
          > the value of the id attribute in the orderheader and party tables.
          >
          > Except in the case described above, this is not supported.
          >
          > -- Ron
          >
          > -- Ron
          > > can i do something like this.
          > > thank u so much for answering all my previous Qs
          > > thanks
          > > sharada.
          > >
          > >
          > > To post a message, send it to: xml-dbms@y...
          > > To unsubscribe, send a blank message to: xml-dbms-unsubscribe@y...
          > > Or join the newsgroup at: news://news.barkto.com/homeless.xml.xml-
          dbms
          > >
          > > Your use of Yahoo! Groups is subject to
          http://docs.yahoo.com/info/terms/
          >
          > --
          > Ronald Bourret
          > Programming, Writing, and Research
          > XML, Databases, and Schemas
          > http://www.rpbourret.com
        • rpbourret@rpbourret.com
          ... I assume that the table has an auto-increment column that is the key column? If so, you can use this in version 2.0. When you define the primary key in the
          Message 4 of 13 , Nov 22, 2002
          • 0 Attachment
            > Hi,
            > I sequence means its oracle sequence for generating the autonumber.
            > is there a possibility to read the value from a sequence and write
            > to the primary key.

            I assume that the table has an auto-increment column that is the key column? If
            so, you can use this in version 2.0. When you define the primary key in the map
            file, you use the Database value for the KeyGenerator attribute of PrimaryKey:

            <PrimaryKey KeyGenerator="Database">
            <UseColumn Name="name-of-the-autoincrement-column" />
            </PrimaryKey>

            If the auto-increment column is somewhere else -- such as in a different table
            -- you can write an implementation of the KeyGenerator interface and retrieve
            the value for insertion into your table. This works in versions 1.x and 2.0.

            --
            Ron
          Your message has been successfully submitted and would be delivered to recipients shortly.