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 » ESQL assistance for the following XML scenario

Post new topic  Reply to topic
 ESQL assistance for the following XML scenario « View previous topic :: View next topic » 
Author Message
CHERIANV
PostPosted: Mon Jan 21, 2008 6:20 pm    Post subject: ESQL assistance for the following XML scenario Reply with quote

Apprentice

Joined: 15 Feb 2002
Posts: 43
Location: New York

Hi -
This looks simple but I'm having some issues. I need to extract the <TotalAmount> field where the attribute type='PurAmt' and assign it to an MRM field. I tried the different SELECT clauses and have no luck. Can someone suggest what is the best ESQL to extract this field ? Thanks !

<?xml version="1.0" encoding="UTF-8"?>
<Body>
<Line>
<TotalAmount currency="USD" type="PurAmt">10000.00</TotalAmount>
<TotalAmount currency="USD" type="NetAmt">20000.00</TotalAmount>
<TotalAmount currency="USD" type="ListAmt">30000.00</TotalAmount>
</Line>
</Body>
Back to top
View user's profile Send private message
AkankshA
PostPosted: Mon Jan 21, 2008 7:48 pm    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

What all select clauses you have already tried.?
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
kimbert
PostPosted: Tue Jan 22, 2008 1:52 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Can someone suggest what is the best ESQL to extract this field ?
Which domain are you using to parse the XML message?
Back to top
View user's profile Send private message
CHERIANV
PostPosted: Tue Jan 22, 2008 4:42 am    Post subject: Reply with quote

Apprentice

Joined: 15 Feb 2002
Posts: 43
Location: New York

Here are the SELECT clauses I tried that hasnt worked :
1.)
SET OutputRoot.MRM.CONTROL_RECORD..ZPURAMT = THE(SELECT ITEM TBL.TotalAmount FROM InputRoot.XML.Body.Line AS TBL
WHERE TBL.TotalAmount.(XML.attr)type = 'PurAmt');

2.)SET OutputRoot.MRM.CONTROL_RECORD..ZPURAMT = (SELECT TBL.TotalAmount FROM InputRoot.XML.Body.Line AS TBL
WHERE TBL.TotalAmount.(XML.attr)type = 'PurAmt');

3.)SET OutputRoot.MRM.CONTROL_RECORD..ZPURAMT = (SELECT ITEM TBL.TotalAmount FROM InputRoot.XML.Body.Line AS TBL
WHERE TBL.TotalAmount.(XML.attr)type = 'PurAmt');

Any clues on what would work in this scenario ?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jan 22, 2008 4:52 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Please don't use the XML domain.

I assume that the two dots between CONTROL_RECORD and ZPURAMT is a typo here, and not in your code.

What is populated in the output field from each of those selects?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
CHERIANV
PostPosted: Tue Jan 22, 2008 10:24 am    Post subject: Reply with quote

Apprentice

Joined: 15 Feb 2002
Posts: 43
Location: New York

What does it mean to not use the XML domain ? Not to use it just in the SELECT clause or not to use the domain itself . What are the other options ?

You're right. The two dots are a typo and not in the code.

Nothing is populated from either of the SELECTs. I am tying to get the code to extract TotalAmount = 10000 for type = PurAmt.

Thanks for your assistance !
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jan 23, 2008 3:06 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
What are the other options ?

http://www.mqseries.net/phpBB2/viewtopic.php?t=34373
Back to top
View user's profile Send private message
CHERIANV
PostPosted: Wed Jan 23, 2008 7:02 pm    Post subject: Reply with quote

Apprentice

Joined: 15 Feb 2002
Posts: 43
Location: New York

Thanks ! I was able to resolve this.
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 » ESQL assistance for the following XML scenario
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.