Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: XML columns

  1. #1
    Join Date
    Jan 2006
    Posts
    119

    Unanswered: 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?

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    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.

  3. #3
    Join Date
    Jan 2006
    Posts
    119
    Quote Originally Posted by sathyaram_s View Post
    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.

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  5. #5
    Join Date
    Jan 2006
    Posts
    119
    Quote Originally Posted by Marcus_A View Post
    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.

  6. #6
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746
    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".

  7. #7
    Join Date
    Jan 2006
    Posts
    119
    Quote Originally Posted by dr_te_z View Post
    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.

  8. #8
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Quote Originally Posted by Breako View Post
    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

  9. #9
    Join Date
    Jan 2006
    Posts
    119
    Quote Originally Posted by Marcus_A View Post
    That is what I am beginning to suspect.
    Google - It sounds like something a child would say

  10. #10
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483

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

  12. #12
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by Breako View Post

    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.

  13. #13
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746

  14. #14
    Join Date
    Jan 2006
    Posts
    119
    Quote Originally Posted by n_i View Post
    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.

  15. #15
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •