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 Select Transformation

Post new topic  Reply to topic Goto page Previous  1, 2
 Esql Select Transformation « View previous topic :: View next topic » 
Author Message
adubya
PostPosted: Thu Feb 23, 2017 12:56 am    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

I tried, and failed, to achieve your goal using one SELECT statement
_________________
Independent Middleware Consultant
andy@knownentity.com
Back to top
View user's profile Send private message Send e-mail
rekarm01
PostPosted: Sat Feb 25, 2017 6:38 pm    Post subject: Re: Esql Select Transformation Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

adubya wrote:
I tried, and failed, to achieve your goal using one SELECT statement

It seems like this should have worked:

Code:
SET OutputRoot.XMLNSC.Output.LineItem[] = SELECT L.LineNum AS LineNum, A AS AssociatedLineNum
    FROM InputRoot.XMLNSC.Order.LineItem[] AS L, L.AssociatedLineNums.AssociatedLineNum[] AS A;

But since the behavior of nested lists in a FROM clause is not well documented, who knows what it should have done?

What it does instead is to abort the selection at the first occurrence of LineItem where AssociatedLineNum[] is an empty list. One way to work around that problem is to add another SELECT call to filter out the empty lists.

Don't try to get too clever with the SELECT function though; sometimes it's better to just use a loop instead. The syntax of the FOR loop might be a bit mixed up, (should it be "value(s) AS variable", or "variable AS value(s)"?), but at least its behavior is well documented.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Sat Feb 25, 2017 10:55 pm    Post subject: Re: Esql Select Transformation Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

rekarm01 wrote:


Don't try to get too clever with the SELECT function though; sometimes it's better to just use a loop instead. The syntax of the FOR loop might be a bit mixed up, (should it be "value(s) AS variable", or "variable AS value(s)"?), but at least its behavior is well documented.




I have found in 40+ years of software development that KISS rules ok (Keep it simple stupid)

Just think for a moment about the person who has to maintain your code. Can they understand and if needed make changes to your nested select?
The two step solution with appropriate comments is IMHO the way to go.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Esql Select Transformation
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.