|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Renaming of DB2 columns |
« View previous topic :: View next topic » |
Author |
Message
|
NickB |
Posted: Fri May 17, 2002 5:30 am Post subject: Renaming of DB2 columns |
|
|
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 |
|
 |
philip.baker |
Posted: Fri May 17, 2002 6:15 am Post subject: |
|
|
 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 |
|
 |
NickB |
Posted: Fri May 17, 2002 7:00 am Post subject: |
|
|
Centurion
Joined: 20 May 2001 Posts: 107 Location: Zurich Financial Services
|
Phil - I like your reply, thanks a lot. |
|
Back to top |
|
 |
kirani |
Posted: Fri May 17, 2002 7:33 am Post subject: |
|
|
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 |
|
 |
NickB |
Posted: Mon May 20, 2002 11:37 pm Post subject: |
|
|
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 |
|
 |
Outdesign |
Posted: Tue May 21, 2002 4:28 am Post subject: |
|
|
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 |
|
 |
|
|
 |
|
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
|
|
|
|