943,982 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Oct 26th, 2007
0

XML Schema/Relational Schema in DB29

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
v.godhe is offline Offline
21 posts
since Oct 2007
Oct 26th, 2007
0

Re: XML Schema/Relational Schema in DB29

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.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
dilasing is offline Offline
76 posts
since Oct 2007
Nov 1st, 2007
0

Re: XML Schema/Relational Schema in DB29

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?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
v.godhe is offline Offline
21 posts
since Oct 2007
Nov 1st, 2007
0

Re: XML Schema/Relational Schema in DB29

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.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
dilasing is offline Offline
76 posts
since Oct 2007
Nov 1st, 2007
0

Re: XML Schema/Relational Schema in DB29

Is there any way to validate the XML data against a XML schema before inserting into the database?
Reputation Points: 10
Solved Threads: 0
Light Poster
ssahil11 is offline Offline
31 posts
since Oct 2007
Nov 1st, 2007
0

Re: XML Schema/Relational Schema in DB29

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.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
dilasing is offline Offline
76 posts
since Oct 2007
Nov 1st, 2007
0

Re: XML Schema/Relational Schema in DB29

When should I choose to validate on Server?
Reputation Points: 10
Solved Threads: 0
Light Poster
ssahil11 is offline Offline
31 posts
since Oct 2007
Nov 1st, 2007
0

Re: XML Schema/Relational Schema in DB29

DB2 9 supports validation on the server. You should validate incoming XML documents on the server if the incoming XML documents must be valid, but the XML documents are from an un-trusted source. For instance, suppose that a mortgage company has received an XML document of an application from a mortgage broker. All brokers develop their own applications to fill out the application forms, and to generate XML documents. Because the mortgage company has no control over these applications, and the applications might or might not follow the industrial standard XML schemas, the incoming XML documents are considered as being from an un-trusted source. The mortgage company must ensure that all XML documents are valid, and can validate all XML documents on the server side at insert and import time. The XMLVALIDATE function is used for validating XML documents with an insert statement in an application. The XMLVALIDATE function checks XML documents against the specified XML schema and makes sure that the XML document satisfies the constraints in the XML schema. When validating XML documents, the schema information passed to the XML validate function can be either explicitly passed (explicit validation) or implicitly inferred from the XML document (implicit validation). You can check http://www.ibm.com/developerworks/xm...y/x-style.html for defining data validation rules in XML schema.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
dilasing is offline Offline
76 posts
since Oct 2007
Nov 1st, 2007
0

Re: XML Schema/Relational Schema in DB29

What is difference between explicit validation and implicit validation?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
v.godhe is offline Offline
21 posts
since Oct 2007
Nov 1st, 2007
0

Re: XML Schema/Relational Schema in DB29

The main difference between explicit validation and implicit validation is where the schema information (hints) are provided. For explicit validation, schema information is provided by the ACCORDING TO XMLSCHEMA clause embedded in the insert statement. For implicit validation, schema hints are provided by the inserting XML document.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
dilasing is offline Offline
76 posts
since Oct 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in XML, XSLT and XPATH Forum Timeline: Bug in XPathAPI.selectSingleNode ???
Next Thread in XML, XSLT and XPATH Forum Timeline: Java Script Menu with XML menu entries.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC