You can use a UDF to access and read XML documents. For example,
if you want to convert data in an XML document into relational table format,
you can create a UDF to perform the conversion. Use the New XML Table Function
wizard to create a DB2 table UDF that takes input from the XML
document that you specify and returns it in table format for a relational
database. With the wizard, you can also specify that you want to run an XSL
transformation on the XML document before the data extracts.
- Switch to the Data perspective.
- Click File > New > Other to open the New
dialog.
- Select Data and choose User-Defined
Function.
- Click Next. The wizard
opens.
- On the Specify a Project page, choose to
use a new project or select an existing data development project.
- Click Next. The Name
and Language page opens.
- In the Language field, select SQL-XML.
- Complete the necessary steps of the wizard.
- Click Finish.
The user-defined function is created and added to the data development
project that you specified, and the user-defined function is deployed and
registered on the database server.