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 » Renaming of DB2 columns

Post new topic  Reply to topic
 Renaming of DB2 columns « View previous topic :: View next topic » 
Author Message
NickB
PostPosted: Fri May 17, 2002 5:30 am    Post subject: Renaming of DB2 columns Reply with quote

Centurion

Joined: 20 May 2001
Posts: 107
Location: Zurich Financial Services

I need to query an external database from a compute node and output the results to an XML message. So for example, I can code the following:

SET "OutputRoot".XML.ClaimEvent.(XML.attr)AssignedOffice = THE
(SELECT ITEM T1.ASSGN_OFFC
FROM Database.C01 AS T1
WHERE T1.CLM_NBR = Parm);

However, if I wish to query 2 columns from the same row to assign to 2 differently named XML fields, I do not want to issue 2 distinct queries as this would be inefficient.

How can I code this in eSQL?
Back to top
View user's profile Send private message
philip.baker
PostPosted: Fri May 17, 2002 6:15 am    Post subject: Reply with quote

Voyager

Joined: 21 Mar 2002
Posts: 77
Location: Baker Systems Consulting, Inc. - Tampa

Hi NickB,

One solution that would work might consist of one compute node doing the query:

Set "OutputRoot".XML.OutRoot.OutLocation[]=(Select T1.OFFICE, T1.ADDRESS FROM Database.MQSIUID.OFFICEINFO AS T1 WHERE T1.NUM = Parm );

The next compute node in the flow could then set the two XML fields separately:

SET "OutputRoot".XML.ClaimEvent.(XML.attr)AssignedOffice = "InputRoot".XML.OutRoot.OutLocation.OFFICE;

SET "OutputRoot".XML.ClaimEvent.(XML.attr)AssignedOfficeLocation = "InputRoot".XML.OutRoot.OutLocation.ADDRESS;


However, I can't help but think there is probably a better solution.

Regards,
Phil
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
NickB
PostPosted: Fri May 17, 2002 7:00 am    Post subject: Reply with quote

Centurion

Joined: 20 May 2001
Posts: 107
Location: Zurich Financial Services

Phil - I like your reply, thanks a lot.
Back to top
View user's profile Send private message
kirani
PostPosted: Fri May 17, 2002 7:33 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Nick,
You may use single compute node to do this,

Set OutputLocalEnvironment.Variables.OutLocation[]=(Select T1.OFFICE, T1.ADDRESS FROM Database.MQSIUID.OFFICEINFO AS T1 WHERE T1.NUM = Parm );

SET "OutputRoot".XML.ClaimEvent.(XML.attr)AssignedOffice = OutputLocalEnvironment.Variables.OutLocation.OFFICE;
SET "OutputRoot".XML.ClaimEvent.(XML.attr)AssignedOfficeLocation = OutputLocalEnvironment.Variables.OutLocation.ADDRESS;
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
NickB
PostPosted: Mon May 20, 2002 11:37 pm    Post subject: Reply with quote

Centurion

Joined: 20 May 2001
Posts: 107
Location: Zurich Financial Services

Kiran

Your solution is very neat, but I think I require WMQI 2.1 to use the Correlation name "OutputLocalEnvironment".
Back to top
View user's profile Send private message
Outdesign
PostPosted: Tue May 21, 2002 4:28 am    Post subject: Reply with quote

Apprentice

Joined: 16 Sep 2001
Posts: 38
Location: Hampshire, UK

Nick,

Yes, you require WMQIv2.1 to use the Correlation name "OutputLocalEnvironment".

If you are using MQSIv2.0.* then you can use the DestinationList as a
temporary storage area by coding the following (this ESQL is within the same Compute node) :

Set OutputDestinationList.TempStorageArea.OutLocation[]
=(Select T1.OFFICE, T1.ADDRESS FROM Database.MQSIUID.OFFICEINFO AS T1 WHERE T1.NUM = Parm );

SET "OutputRoot".XML.ClaimEvent.(XML.attr)AssignedOffice
= OutputDestinationList.TempStorageArea.OutLocation.OFFICE;
SET "OutputRoot".XML.ClaimEvent.(XML.attr)AssignedOfficeLocation
= OutputDestinationList.TempStorageArea.OutLocation.ADDRESS;
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Renaming of DB2 columns
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.