Why would I ever choose to store and manipulate XML in a relational database?

后端 未结 11 2075
谎友^
谎友^ 2020-12-08 03:38

Modern RDBMS\'s have support for XML column types and functionality for dealing with XML in stored procedures. Historically I would always have mapped hierarchical data (whe

11条回答
  •  醉梦人生
    2020-12-08 04:15

    Here is a real world example from a system I work on. We have a core system and create customer-specific code in java. A different class may be called depending on which customer is transacting. Sometimes this custom code needs to store something and we put it into an XML column in the relevant table. This saves us from modeling everything under the sun. Adding a new customer generally just means writing and installing the java code.

    The downside is that reporting, querying and updates are more difficult on the XML column. There are none of the usual good database features like check constraints, etc.

提交回复
热议问题