| |
|
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.
|
 |
|

08-23-11, 18:28
|
|
Registered User
|
|
Join Date: Jan 2006
Posts: 119
|
|
|
XML columns
|
|
The DB2 fundamentals states that XML columns are used to store documents as a hierarchial set of entities.
What exactly does "hierachial set of entities" mean in this context?
|
|

08-23-11, 19:51
|
|
Super Moderator
|
|
Join Date: Aug 2001
Location: UK
Posts: 4,534
|
|
As you know, XML is data hierarchy.
Before pureXML, XML document was shredded and stored in multiple tables.
With pure XML, the data is not shred but stored in the native XML format - ie data hierarchy is 'known' within the column itself and not by external relationships.
I guess that what it means.
Are you after something specific ?
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
|
|

08-24-11, 04:35
|
|
Registered User
|
|
Join Date: Jan 2006
Posts: 119
|
|
|
|
Quote:
Originally Posted by sathyaram_s
As you know, XML is data hierarchy.
Before pureXML, XML document was shredded and stored in multiple tables.
With pure XML, the data is not shred but stored in the native XML format - ie data hierarchy is 'known' within the column itself and not by external relationships.
I guess that what it means.
Are you after something specific ?
|
that's a pretty excellent explanation.
Well done.
|
|

08-24-11, 05:49
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,196
|
|
A “hierarchical” structure is characteristic of XML, as opposed to relational or network structures that allow many-to-many and other more complex kinds of relationships between entities. If you want to understand the difference between hierarchical, relational, and network structures, I would suggest Google.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|

08-24-11, 05:51
|
|
Registered User
|
|
Join Date: Jan 2006
Posts: 119
|
|
Quote:
Originally Posted by Marcus_A
A “hierarchical” structure is characteristic of XML, as opposed to relational or network structures that allow many-to-many and other more complex kinds of relationships between entities. If you want to understand the difference between hierarchical, relational, and network structures, I would suggest Google.
|
Google, I have never heard of that.
sathyaram_s gave a perfect answer to the specific question. Thanks.
|
|

08-24-11, 06:52
|
|
Registered User
|
|
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
|
|
You could say that a XML column can contain a tiny little codasyl-database.
Thats why SQL with embedded Xquery or Xquery with embedded SQL can become complex because you will have to redefine your definition of "result set".
|
|

08-24-11, 06:53
|
|
Registered User
|
|
Join Date: Jan 2006
Posts: 119
|
|
Quote:
Originally Posted by dr_te_z
You could say that a XML column can contain a tiny little codasyl-database.
Thats why SQL with embedded Xquery or Xquery with embedded SQL can become complex because you will have to redefine your definition of "result set".
|
Thought provoking. Thanks.
|
|

08-24-11, 07:36
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,196
|
|
Quote:
Originally Posted by Breako
Google, I have never heard of that.
|
That is what I am beginning to suspect. 
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|

08-24-11, 08:25
|
|
Registered User
|
|
Join Date: Jan 2006
Posts: 119
|
|
Quote:
Originally Posted by Marcus_A
That is what I am beginning to suspect. 
|
Google - It sounds like something a child would say 
|
|

08-24-11, 12:35
|
|
Registered User
|
|
Join Date: Feb 2008
Location: Japan
Posts: 2,193
|
|
|
|

08-24-11, 12:38
|
|
Registered User
|
|
Join Date: Jan 2006
Posts: 119
|
|
Thanks. But I think sathyaram_s is far better in this particular case.
Without XML columns, you do not get the opportunity to keep the hierarchial structure. You have to shred. This is the point of them.
|
|

08-24-11, 13:08
|
|
:-)
|
|
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
|
|
Quote:
Originally Posted by Breako
Without XML columns, you do not get the opportunity to keep the hierarchial structure. You have to shred.
|
Not necessarily. You could store the XML data as character or CLOB, which would also preserve their structure.
|
|

08-25-11, 03:05
|
|
Registered User
|
|
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
|
|
|
|

08-25-11, 04:23
|
|
Registered User
|
|
Join Date: Jan 2006
Posts: 119
|
|
Quote:
Originally Posted by n_i
Not necessarily. You could store the XML data as character or CLOB, which would also preserve their structure.
|
Excellent point.
So let's pick this one out.
What does the XML column give you over the CLOB column? Some XMl specific functions I presume.
Note: this is why I posted the question in this forum. Because we can have an interesting discussion.
|
|

08-25-11, 05:21
|
|
Super Moderator
|
|
Join Date: Aug 2001
Location: UK
Posts: 4,534
|
|
To compare storing XML using CLOB, XML extender and XMLColuimn think Notepad, Excel and RDBMS.
With Notepad, you can store data (any seperator). All read-write and manipulation tasks have to be done externally.
With Excel you can store data in columns and sheets, access them using macros, do some checks etc. There is no meta data.
With RDBMS you can store the data in columns and tables, access them using SQL, more complex checks, ease of use, efficient access etc. There is meta data
Now storing XML as CLOB, using XML Extender or using XML columns is similar as above:
As CLOB, you can store XML but for the database it is a just a bunch of characters. You can access it, parse it, validate it all outside the database.
To make the task of storing and using XML as CLOB, there was a product called XML Extender. This provided a set of UDTs, UDFs and Stored Procs. Withing the database, data was stored as CLOB or relational tables. But the the UDTs and Routines helped to make it a bit more easier to store, access and validate and provided very little meta data capabilities (if you call it so). Access was in-efficient.
Using pureXML, when storing data in XML column the database understands XML (stores meta data internally), easy and efficient access, validation against XML Schemas, elements and attributes are indexable etc.
Hope this provides a comparison.
I am no expert in PureXML, so will let someone with more knowledge provide additional details.
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|