ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » DB2 Stored Procedures, Resultsets and XML Attributes.

Post new topic  Reply to topic
 DB2 Stored Procedures, Resultsets and XML Attributes. « View previous topic :: View next topic » 
Author Message
andrewhirst
PostPosted: Mon Jul 26, 2004 6:22 am    Post subject: DB2 Stored Procedures, Resultsets and XML Attributes. Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Mon Jul 26, 2004 6:48 am    Post subject: Reply with quote

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
View user's profile Send private message
andrewhirst
PostPosted: Mon Jul 26, 2004 7:43 am    Post subject: Reply with quote

Apprentice

Joined: 06 Jul 2004
Posts: 33
Location: UK

Many thanks.....

Andrew.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » DB2 Stored Procedures, Resultsets and XML Attributes.
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.