exporting a xml document to a file 
Author Message
 exporting a xml document to a file

Hi,

We run db2 database and websphere on different linux machines here. I'm
trying to get the basic xml functionality of the xml extender work. The code
below exports the generated xml document to a file on the database server's
filesystem but I'd like to have it on the websphere machine so i can
manipulate the xml file.

Question:  How can i put the xml file on the websphere server's filesystem
instead of on the database server?

Since i'm totally new to Db2, i don't know if this is the right way of
getting the information to websphere. The goal is to present data ---witch -
resides in tables - in a webbrowser using xml in between. First, the
database needs to extract the information out of the tables and put it in
another table, then the sql statement below exports it to a temporary file
and then it's being transformed into html.
As a total newbie, i find this overhead. Can't it be done in, let's say, one
sql statement that returns an Object with the xml content?

What about performance with all those extra steps, i'm running it on a small
intel x86 machine so i have no idea of the performance it should get on a
real ibm machine.

Thank you,

Maarten Claes

This code is snipped from the example that came with the Xml extender pdf
manual and is working well if the xmlfile is created on the
database server.
//Export the generated XML document to a file.
 sql = "select db2xml.content(db2xml.XMLVarchar(doc),'/some/dir/test.xml')
from " + resultTab+ " where db2xml.extractVarchar(db2xml.XMLVarchar(doc),

 stmt = con.createStatement();
 stmt.executeQuery(sql);

Links to usefull information about this topic are also welcome.



Tue, 14 Sep 2004 06:34:31 GMT
 exporting a xml document to a file


Quote:
> Hi,

> We run db2 database and websphere on different linux machines here. I'm
> trying to get the basic xml functionality of the xml extender work. The
code
> below exports the generated xml document to a file on the database
server's
> filesystem but I'd like to have it on the websphere machine so i can
> manipulate the xml file.

> Question:  How can i put the xml file on the websphere server's filesystem
> instead of on the database server?

> Since i'm totally new to Db2, i don't know if this is the right way of
> getting the information to websphere. The goal is to present
data ---witch -
> resides in tables - in a webbrowser using xml in between. First, the
> database needs to extract the information out of the tables and put it in
> another table, then the sql statement below exports it to a temporary file
> and then it's being transformed into html.
> As a total newbie, i find this overhead. Can't it be done in, let's say,
one
> sql statement that returns an Object with the xml content?

I think there's a new SP in a later XML Extender fixpack that gets a
document as a CLOB - no need to store it in a table.
http://www-3.ibm.com/software/data/db2/extenders/xmlext/docs/v72wrk/d...
.htm#HDRCLOBS

Then you can pass this value of the SP output parameter either as a String
or a stream to the component that transforms it to HTML.

I'm not 100% sure, but I believe we have a sample that just shows that. have
a look at this: http://www-3.ibm.com/software/data/developer/samples/video/

Quote:
> What about performance with all those extra steps, i'm running it on a
small
> intel x86 machine so i have no idea of the performance it should get on a
> real ibm machine.

real IBM machine=PowerPC? I like that!!! :-)

- Show quoted text -

Quote:
> Thank you,

> Maarten Claes

> This code is snipped from the example that came with the Xml extender pdf
> manual and is working well if the xmlfile is created on the
> database server.
> //Export the generated XML document to a file.
>  sql = "select db2xml.content(db2xml.XMLVarchar(doc),'/some/dir/test.xml')
> from " + resultTab+ " where db2xml.extractVarchar(db2xml.XMLVarchar(doc),

>  stmt = con.createStatement();
>  stmt.executeQuery(sql);

> Links to usefull information about this topic are also welcome.



Tue, 14 Sep 2004 09:25:23 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. converting xml documents to html documents

2. Importing XML document to sp_xml_prepare_document as a file

3. sp_xml_preparedocument on xml document from disk file

4. save an xml document onto a file

5. XML document from SELECT ... FOR XML

6. ADO + XML: Updating recordset from xml-document

7. DTS to export an XML file

8. sql export to xml files

9. How to export data to XML file?

10. Import/Export XML formatted files

11. DTS export of XML to a text file

12. Export data to XML file


 
Powered by phpBB® Forum Software