If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > XML Extender Help please

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-03-05, 21:52
floater_ floater_ is offline
Registered User
 
Join Date: Feb 2005
Posts: 7
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.
Reply With Quote
  #2 (permalink)  
Old 02-03-05, 21:58
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
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.
Reply With Quote
  #3 (permalink)  
Old 02-05-05, 20:24
floater_ floater_ is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On