Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005
    Posts
    7

    Unanswered: XML Extender Help please

    Hello everyone,

    I'm having a problem with the XML extender for DB2. I have an XML file and I was to decompose it to DB2 (one way transfer). So I've tried to create a DAD file to do this. My issue is that in all XML extender examples they always use an Attribute as the primary key! Is there anyway around this? i'd like to use an element as a key instead but it wont let me and the result is it creates n rows for every n <element_nodes> that I have.

    example case that I have which doesn't work.
    <journal>
    <id>111</id> <-- want to set this as PK
    <date>222</date>
    </journal>

    example case which DOES work:
    <journal id="111">
    <date>222</date>
    </journal>

    I have no control over the format of the incoming XML so using the 2nd example isn't an option. Is there anyway I can set the <id> tag to be the key in the DAD file instead of using the <attribute> tag?

    I'd appreciate any help on this issue, and I can clarify if this doesnt make sense. Please help if you have knowledge on this subject, thanks so much.

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    You could create an XSL transformation to convert the XML you have into what DB2 wants. It shouldn't be too much of a problem if the actual files are as simple as the examples you've given.

  3. #3
    Join Date
    Feb 2005
    Posts
    7
    thats actually a pretty good idea but the XML files aren't as easy as the examples I've given. They range in tree depth from 1-9 elements deep with around 30 different tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •