Guys,

I'm working on a system which has to receive XML documents and shred
them into a DB2 database (UDB on AIX V7.2).  I've got the DTD and sample
documents supplied to me by the developers.  My task is to produce a
database schema and a DAD to allow the shredding to take place.

I've got lots of questions ...

Let's say the XML structure was -

<PERSONAL_DETAILS>
<NAME>Someone</NAME>
<AGE>50</AGE>
<ADDRESS ADDRTYPE="Home">
<ADDR1>Home Street</ADDR1>
<ADDR2>Home Town</ADDR2> 
</ADDRESS>
<ADDRESS ADDRTYPE="Work">
<ADDR1>Work Street</ADDR1>
<ADDR2>Work Town</ADDR2> 
</ADDRESS>
</PERSONAL_DETAILS>

In database terms I'd like to turn this into something like -

CREATE TABLE PERSONAL_DETAILS
(surrogate_key INTEGER NOT NULL,
 NAME CHAR(50) NOT NULL,
 AGE SMALLINT,
 CONSTRAINT pk1 PRIMARY KEY 
);

CREATE TABLE PERS_DETAILS_ADDRESS
(surrogate_key INTEGER NOT NULL,
 address_seqnum SMALLINT NOT NULL,
 ADDR1 VARCHAR(50),
 ADDR2 VARCHAR(50),
 CONSTRAINT pk2 PRIMARY KEY (surrogate_key, address_seqnum)
);
  
ALTER TABLE PERS_DETAILS_ADDRESS
ADD FOREIGN KEY (surrogate_key)
REFERENCES PERSONAL_DETAILS
ON DELETE CASCADE;

Questions are -

Can I get the DB2 shredding SP to produce the surrogate keys and
sequence numbers I need ?
If so, how do I write the DAD to allow this to happen ?

If anyone has done this sort of thing and would be willing to help me
then drop me an email.  I can either use email, Instant Messenger or
phone.

Thanks

Phil Nelson

-
:::  When replying to the list, please use 'Reply-All' and make sure
:::  a copy goes to the list ([EMAIL PROTECTED]).
***  To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
***  For more information, check http://www.db2eug.uni.cc

Reply via email to