This E-Mail is sent in confidence for the addressee only. Unauthorised recipients must preserve this confidentiality and should notify the sender immediately by telephone on 0131-655-6789 and must delete the original E-Mail without taking a copy. If you are not the addressee you must not copy, distribute, disclose or use any of the information in any way.
This E-Mail is not intended nor should it be taken to create any legal relations, contractual or otherwise. We have taken all reasonable precautions to ensure that no viruses are transmitted from the Scottish Widows Group of companies to any third party. Scottish Widows accepts no responsibility for any loss or damage resulting directly or indirectly from the use of this E-Mail or the contents. ***************************************************************************** Jay, What you've said is kind of what I expected. I feel a Perl program may be in order, using the XML Parser tools !!! Phil -----Original Message----- From: Jackson Reavill [mailto:[EMAIL PROTECTED] Sent: 01 October 2003 16:01 To: Philip Nelson Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [DB2EUG] XML Extender Help Please Hi Phil, As far as I'm aware there is no way of generating a key like you want to during a shred activity. Unfortunately, shred is not very flexible. It's basically just an element to column mapping device. If it were only one table being shredded into then you could use an identity column or a trigger. But with child tables needing the same migrated key I'm not seeing how it could be done without the potential for not getting the same key. Such as a before insert trigger on the child table that queries the parent table to get the latest key (the one just generated during insert by the shred). But with a high transaction rate this could get ugly. If possible (and it's probably not), it seems the best thing to do is generate the key prior to formulating the XML. Then shred can just map it in. Sorry I don't have better news, but maybe someone else has conquered this one, Jay Jay Reavill [EMAIL PROTECTED] IBM Global Services Tampa, Florida Tel: (813) 356-5317, Tie Line 8-697-5317 ----------------------------------------------------- Happiness is not around the corner. Happiness is the Contour (SVT) of the road. ----------------------------------------------------- The early bird gets the worm, but the second mouse gets the cheese. ----------------------------------------------------- Philip Nelson <[EMAIL PROTECTED] To: [EMAIL PROTECTED] om> cc: Sent by: Subject: [DB2EUG] XML Extender Help Please [EMAIL PROTECTED] ash.org 10/01/2003 08:05 AM Please respond to Philip Nelson 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 - ::: 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 ***************************************************************************** Visit the Scottish Widows website at www.scottishwidows.co.uk Scottish Widows Group includes the following companies:- Scottish Widows plc, Company No. 199549. Regulated by the Financial Services Authority. Scottish Widows Annuities Limited, Company No. 199550. Regulated by the Financial Services Authority. Scottish Widows Services Limited, Company No. 189975. The Registered Office of all of the above companies is in the United Kingdom at 69 Morrison Street, Edinburgh, EH3 8YF. Telephone: 0131 655 6000 Scottish Widows Unit Trust Managers Limited, Company No. 1629925 Registered Office: is in the United Kingdom at Charlton Place, Andover, Hampshire SP10 1RE. Telephone: 0845 300 2244 Regulated by the Financial Service Authority. Scottish Widows Investment Partnership Limited, Company No. 794936 Registered Office : is in the United Kingdom at 10 Fleet Place, London EC4M 7RH. Telephone: 0131 655 8500 Regulated by the Financial Services Authority. Scottish Widows Fund Management Limited, Company No. 74517. Regulated by the Financial Services Authority. Pensions Management (SWF) Limited, Company No. 45361. Regulated by the Financial Services Authority. The Registered Office of the above two companies is in the United Kingdom at 15 Dalkeith Road, Edinburgh, EH16 5BU. Tel 0131 655 6000 The companies listed above are members of the Scottish Widows and Lloyds TSB Marketing Group- Scottish Widows Bank plc, Company No. 154554 Registered Office: is in the United Kingdom at 67 Morrison Street, Edinburgh, EH3 8YJ. Telephone: 0845 845 0829 Regulated by the Financial Services Authority Hill Samuel Unit Trust Managers Limited, Company No 406604 Registered Office: is in the United Kingdom at 10 Fleet Place, London, EC4M 7RH Telephone: 0800 336600 Regulated by the Financial Services Authority Hill Samuel Asset Management International Limited, Company No 106723 Registered Office: is in the United Kingdom at 15 Dalkeith Road, Edinburgh, EH16 5BU Telephone: 0131 655 8500 Regulated by the Financial Services Authority All of the above companies are part of the Lloyds TSB Group. - ::: 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
