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 » CASE statement and IN Clause

Post new topic  Reply to topic
 CASE statement and IN Clause « View previous topic :: View next topic » 
Author Message
Rookwood
PostPosted: Fri Jan 20, 2006 5:09 am    Post subject: CASE statement and IN Clause Reply with quote

Novice

Joined: 26 Aug 2004
Posts: 13

Hi,

environment: V5.0 CSD 4 on W2K.

Task I'm trying to solve is:
I've built a list of values in three Environment tree based structures

Environment.Variables.skipColumn.Col[]
Environment.Variables.skipStoreColumn.Col[]
Environment.Variables.useStoreColumn.Col[]

I'm then wanting to use a CASE statement with IN clauses to determine if a particular character value appears in the three trees and perform processing accordingly.

I naively tried.

CASE
WHEN fieldNameValue IN (select X.Col from Environment.Variables.skipColumn[] AS X) THEN
-- perform some task
CASE
WHEN fieldNameValue IN (select X.Col from
Environment.Variables.skipStoreColumn[] AS X)
-- perform some task
etc
END CASE;

Syntax check in Toolkit ESQL Editor has no complaints. However, when I attempt to deploy the flow I receive error back stating ...expected ) but found X.." at the position of the first WHEN clause.

I can find alterative routes around this problem, e.g. build up text string of values in Col[] using concatentation and then using POSITION function in my CASE statement, but feel there must be a more elegant solution.

Thanks
Graham
_________________
GS
Back to top
View user's profile Send private message
mgk
PostPosted: Fri Jan 20, 2006 6:47 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

In ESQL the operator IN cannot contain a list expression (which is what SELECT returns).

You could try something like (code not tested):

SET res1 = THE(select ITEM X.Col from Environment.Variables.skipColumn[] AS X WHERE X.col = fieldNameValue );

IF res1 = fieldNameValue THEN ..do processing... END IF

SET res2 = ... the same again for the second select...

...etc...


Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
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 » CASE statement and IN Clause
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.