Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle -> xml

Status
Not open for further replies.

cwsstins

MIS
Aug 10, 2004
412
US
Sorry to cross-post, but I need some help here and there were no responses in the 8i forum:

Oracle 8.1.7.4: Need to produce table data output to .xml file. I picked up the following code from Dima in an old post:

Code:
set pages 0
set long 100000
select xmlgen.getxml('select fld from tbl') from dual;
This works, but I need to specify the tags rather than having <ROW></ROW> tags. To further complicate things, I need different tags depending on whether the field is "standard" or "custom". How can I specify what the tags should be? For instance:

There are a number of fields that are considered standard, so the tags indicate the field name:
<merchant_address1>3111 'C' STREET</merchant_address1>
<merchant_address2>Merchant Address 2</merchant_address2>
<merchant_city>ANCHORAGE</merchant_city>
<merchant_state>AK</merchant_state>
<merchant_zip>99503</merchant_zip>

There are a number of fields that are considered custom, and need to have generic tags:
- <customer_spec_info>
<field_name>STARTDT</field_name>
<field_value>1991-12-17</field_value>
</customer_spec_info>
- <customer_spec_info>
<field_name>STATUSCD</field_name>
<field_value>value for field above</field_value>
</customer_spec_info>
- <customer_spec_info>
<field_name>SUSPENDDT</field_name>
<field_value>value for field above</field_value>
</customer_spec_info>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top