Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Storing XML in an 8i DB

Re: Storing XML in an 8i DB

From: Bell <ohnoyoudont_at_servernotfound.com>
Date: Fri, 23 Mar 2001 16:26:24 GMT
Message-ID: <QOKu6.518884$JT5.14699058@news20.bellglobal.com>

If the length of your XML document is always less than 32767 bytes you can use a LONG column with no problems in PL/SQL, otherwise you are stuck using OCI to perform the insert.

To extract the data you have a little more flexibility as you can use dbms_sql package to get at the chunks in the long column by reading so many bytes unitl the number of bytes read is 0.

One more thing to menition, you cannot search on a long column therefore you cannot find all xml docs that have a certain tag.

HTH
Scott.

""Louis"" <tevere66_at_hotmail.com> wrote in message news:OE20xfPTeip68V8zDv600003420_at_hotmail.com... I need to store xml documents in an 8i database table. Can someone recommend the best way to do this? Should I store the document as a binary or store the actual string value that makes up the text. The size may be greater than 4000 characters, so I cant use a VARCHAR2.

I've read that Oracle recommends using LOB's, but I'll need to be backward compatiple with pre "i" databases (v7 & 8). I've tried using LONG, but am having problems testing with SQL*Plus b/c of the difference in PL LONG and a dbms LONG.

I plan to use a stored procedure to do the INSERTs into the table by having an IN parameter that passes the document (or string, which ever the case) to the procedure.

thanks Received on Fri Mar 23 2001 - 10:26:24 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US