|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
DB2 Stored Procedures, Resultsets and XML Attributes. |
« View previous topic :: View next topic » |
Author |
Message
|
andrewhirst |
Posted: Mon Jul 26, 2004 6:22 am Post subject: DB2 Stored Procedures, Resultsets and XML Attributes. |
|
|
 Apprentice
Joined: 06 Jul 2004 Posts: 33 Location: UK
|
Hello,
I am calling a DB2 stored procedure, using the ESQL PASSTHRU command, that returns a resultset consisting of 1 row of data. The returned data is then used to build the XML output message using:
SET OutputRoot.XML.vehicle[] = PASSTHRU('{CALL DB2.GETDETAILS(?, ?)}', 'ABC123','');
This works and produces XML.
The XML is then returned to a webapp that validates the XML against a DTD. This fails, because the DTD uses attributes and the returned XML is straight-forward simple XML.
I can create an XML attribute by using:
SET "OutputRoot"."XML"."vehicle".(XML.Attribute)vin = 'ABC123';
Is there anyway to map the data returned from the SP into attributes defined in the DTD or do I have to write a parser in ESQL to set the attributes?
Or am I missing something entirely.....?
Many thanks in advance..
Andrew Hirst. |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jul 26, 2004 6:48 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Code: |
SET Environment.Variables.Details[] = PASSTHRU('{CALL DB2.GETDETAILS(?, ?)}', 'ABC123','');
Set OutputRoot.XML.vehicle.Field1 = Environment.Variables.Details.Field1;
Set OutputRoot.XML.vehicle.Field1.(XML.Attribute)attr1 = Environment.Variables.Details.attr1; |
For example. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
andrewhirst |
Posted: Mon Jul 26, 2004 7:43 am Post subject: |
|
|
 Apprentice
Joined: 06 Jul 2004 Posts: 33 Location: UK
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|