User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the XML, XSLT and XPATH section within the Software Development category of DaniWeb, a massive community of 456,575 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,628 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our XML, XSLT and XPATH advertiser: Programming Forums
Views: 6737 | Replies: 49
Reply
Join Date: Oct 2007
Posts: 21
Reputation: v.godhe is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
v.godhe v.godhe is offline Offline
Newbie Poster

Question XML Schema/Relational Schema in DB29

  #1  
Oct 26th, 2007
I have some data that I want to store in the DB2 9. Should I store this data as XML schema or relational schema?
Last edited by v.godhe : Oct 26th, 2007 at 6:31 am.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Posts: 76
Reputation: dilasing is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
dilasing dilasing is offline Offline
Junior Poster in Training

Re: XML Schema/Relational Schema in DB29

  #2  
Oct 26th, 2007
This depends on the data you want to store in the database. The main difference between relational schema and XML schema is that relational schema describes data as strongly structured and typed. XML schema describes data as loosely structured and typed. XML schema describes data order, but relational schema does not.
In general, data that has the following properties should be stored in XML:
The data is better described in hierarchal format.
The schema is constantly changing and evolving.
Many attributes of the data are empty or unknown.
You can check http://www.ibm.com/developerworks/xm...GX06&S_CMP=EDU for advice on creating XML.
Reply With Quote  
Join Date: Oct 2007
Posts: 21
Reputation: v.godhe is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
v.godhe v.godhe is offline Offline
Newbie Poster

Question Re: XML Schema/Relational Schema in DB29

  #3  
Nov 1st, 2007
The data which I want to store in the database contains small amount of data, but have a highly complex structure. Should I store this in XML data type?
Reply With Quote  
Join Date: Oct 2007
Posts: 76
Reputation: dilasing is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
dilasing dilasing is offline Offline
Junior Poster in Training

Re: XML Schema/Relational Schema in DB29

  #4  
Nov 1st, 2007
You should store such data in XML. If you store such data in relational tables, you will have complicated relational schemas, which means you require many tables. Managing these tables can have overhead. The SQL query to access such data requires joining many tables. If you have to process this data together with other data, the SQL query will be even more complicated.
Reply With Quote  
Join Date: Oct 2007
Posts: 31
Reputation: ssahil11 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
ssahil11 ssahil11 is offline Offline
Light Poster

Re: XML Schema/Relational Schema in DB29

  #5  
Nov 1st, 2007
Is there any way to validate the XML data against a XML schema before inserting into the database?
Reply With Quote  
Join Date: Oct 2007
Posts: 76
Reputation: dilasing is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
dilasing dilasing is offline Offline
Junior Poster in Training

Re: XML Schema/Relational Schema in DB29

  #6  
Nov 1st, 2007
DB2 9 supports validating XML documents with XML schema at insert or import time. The XML schemas have to be registered in XML Schema Repository (XSR) before it can be used for validation. The XML document in the same XML type column can be validated by a different XML schema of your choice in the insert/import time. You can also choose not to validate the XML. In general, there are three choices:
Validate on the server.
Validate within an application.
Do not validate.
XML validation enables you to create complex rules that define acceptable data. You can check http://www.ibm.com/developerworks/xm...ary/x-tipxsslt to use the XML Schema Standard Type Library to simplify the process of requiring formatted data such as e-mail addresses and telephone numbers.
Reply With Quote  
Join Date: Oct 2007
Posts: 12
Reputation: kzubair96 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
kzubair96 kzubair96 is offline Offline
Newbie Poster

Re: XML Schema/Relational Schema in DB29

  #7  
Nov 14th, 2007
I know that we can validate the XML data against registered XML schema. But how does DB 2 manage XML schemas in general?
Reply With Quote  
Join Date: Oct 2007
Posts: 76
Reputation: dilasing is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
dilasing dilasing is offline Offline
Junior Poster in Training

Re: XML Schema/Relational Schema in DB29

  #8  
Nov 15th, 2007
Originally Posted by kzubair96 View Post
I know that we can validate the XML data against registered XML schema. But how does DB 2 manage XML schemas in general?


Applications can choose to validate XML documents against an XML schema to ensure valid data is stored in the database. To validate documents, DB2 needs access to the appropriate schema information. For this reason, DB2 has an XML schema repository (XSR) that maintains a copy of the XML schemas that might be used during validation. The XSR consists of a set of new catalog tables together with commands, stored procedures and APIs to register and manage XML schemas. You can check http://www.ibm.com/developerworks/xm...y/x-style.html for defining data validation rules in XML schema.
Reply With Quote  
Join Date: Oct 2007
Posts: 12
Reputation: kzubair96 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
kzubair96 kzubair96 is offline Offline
Newbie Poster

Re: XML Schema/Relational Schema in DB29

  #9  
Nov 16th, 2007
do I have to register a XML schema in XSR before using it for validation?
Reply With Quote  
Join Date: Oct 2007
Posts: 76
Reputation: dilasing is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
dilasing dilasing is offline Offline
Junior Poster in Training

Re: XML Schema/Relational Schema in DB29

  #10  
Nov 18th, 2007
Yes, A XML schema has to be registered in XSR before it can be used for validation.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb XML, XSLT and XPATH Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the XML, XSLT and XPATH Forum

All times are GMT -4. The time now is 6:16 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC