Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: XML and binary data into Oracle
On Wed, 4 May 2005 08:29:00 +0100, Jeremy
<newspostings_at_hazelweb.co.uk> wrote:
>Platform: Oracle 9iR2 / Sun Solaris 9
>
>
>
>Maybe this is actually a post more suited to an XML newsgroup, but does
>anyone know if you can (a) embed binary data into an xml document and
>(b) whether Oracle's tools using XMLTYPE will automatically handle the
>storage of that binary data?
>
>We have successfully implemented inserting XML documents into Oracle
>tables defined e.g.
>
>create global temporary table xml_jobs of xmltype;
>
>and then defining views on that table based on the XML schema defintion.
>
>The requirment in summary is that a 3rd party wishes to send us some
>structured data and an embedded MS Word (or other binary) document in a
>single XML document. I think the suggestion is that the content of the
>MS Word document will be encoded before it is sent and then we woould
>have to decode it upon receipt - actually I guess this would then
>actually make the question about whether binary data can be included
>redundant - then the question would be actually just how would you "re-
>form" the MS word (or whatever) document using pl/sql?
>
>An alternative that has ben suggested is that one of the fields in the
>XML document would be a URL where the MS Word document can be found and
>then from within pl/sql we could use utl_http to get the document?
>
>Thanks for any pointers or thoughts from anyone who has done anything
>similar.
>
>cheers
If it's encoded, it will probably be something like base64. Google
that. Also, check out this link.
http://www.perfectxml.com/articles/xml/binary.asp
I've olny used UTL_HTTP to get HTML but utl_http does support READ_RAW. I'm guessing you could use that to pull from a url.
Hope that helps,
Lewis
Author, ItToolBox Blog: An Expert's Guide to Oracle http://blogs.ittoolbox.com/oracle/guide/
Topic Editor, Suite101.com: Oracle Database http://www.suite101.com/welcome.cfm/oracle
Sign up for courses here:
http://www.suite101.com/suiteu/default.cfm/416752