Quote:
|
Originally Posted by Marcus_A
The largest column size for a CLOB in DB2 (which is where DB2 XML Extender would store the XML) is 2GB (unless it has been changed in DB2 9). The largest column size that can be logged (CLOBs can be defined as NOT LOGGED) is 1 GB.
XML Extender will probably not be supported beyond version 9 or 10, since its functionality has been replaced by "Pure XML" in V9. So use it at your own risk.
|
totally agree with Marcus_A. XML extender is not the best choice if you will deal a lot with XML.
For sandbox purpose, you can try DB2 v9(the expression version is free, I think) and use the 'pure xml' feature. You can store a XML data that larger than 2G. Because by theory, there is no size limitation for XML data though there are system limitation.
Then use XMLTABLE function to split the document into smaller piece before query on the data.
By all means, there is no cheap/easy way to query on a 2G~3G document.
Your case is one of the perfect example for XMLTABLE, the following stmt is from DB2/zos
INSERT INTO YourTargetTable distributorid,sellingind AS
SELECT
FROM XMLTABLE('/Distributor' PASSING CAST(? AS XML)
COLUMNS "DistributorId" INTEGER,
"sellingind" CHAR(5)) X
(1) CAST(? as XML) will bring in your document(in text format),
(2) '/Distributor' will grab each 'Distributor' element from root, which will contruct to each row of the result table X
(3) COLUMNS "DistributorId" INTEGER,
"sellingind" CHAR(5)) X
will get the context of "DistributorId" and "sellingind" element from that particular 'Distributor'.
(4) eventrually, the insert from sub-select will put that data into your regular relational table.
I am pretty positive that DB2 can deal with 1GB document. It will be a challenge for 3GB. But if you are a big customer, DB2 will make it work for you.