Author |
Message
|
Nick Lethbridge |
Posted: Fri Aug 31, 2001 11:39 am Post subject: |
|
|
 Voyager
Joined: 13 Aug 2001 Posts: 88 Location: Santander, UK
|
I specified the following within an ESQL script for a Compute node:
CASE ...............
WHEN '1' OR '2' OR '4' etc.... THEN ....
END;
Although the syntax checker accepted it, when I tried to deploy the message flow it was rejected (did not expect the first OR to be there).
I ended up having to enter n lines of:
WHEN '1' THEN ....
WHEN '2' THEN ....
WHEN '4' THEN ....
etc.
Does anyone know of a way that you can specify a list of values (or a range of values) in a single search condition for a CASE statement ?
Nick |
|
Back to top |
|
 |
kolban |
Posted: Fri Aug 31, 2001 3:26 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
Unfortunately, what you are asking for will not work. The syntax of the CASE statement seems to show that the part following WHEN has to be an expression. By using OR or '|' or other syntactical contructs, it would appear that you are creating a predicate... i.e. something which is true or false and not something which evaluates to a value. |
|
Back to top |
|
 |
wmbv7newbie |
Posted: Tue Mar 24, 2015 12:05 am Post subject: |
|
|
Centurion
Joined: 13 May 2014 Posts: 121
|
Could anybody come with a solution to this? I am facing the same problem and have to write 7 WHEN with CASE although it could have been done in 3 if OR were allowed  |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Mar 24, 2015 1:23 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Your solution is here
http://www.mqseries.net/phpBB2/viewtopic.php?p=337106 _________________ 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 |
|
 |
wmbv7newbie |
Posted: Tue Mar 24, 2015 1:33 am Post subject: |
|
|
Centurion
Joined: 13 May 2014 Posts: 121
|
Works! Thanks
Out of curiosity, how do you people find the right threads so quickly, however old? I tried doing a search of text and I got hundreds of links in response. Thought it better to post the question here.
Some algorithm in place? |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Mar 24, 2015 1:43 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
This one was easy for me to find because I opened the thread I linked to.
I searched for 'SMDavies99 CASE'
and there is was at the top of the list.
Memo to self.... Need to update my list of 'really useful threads'. _________________ 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 |
|
 |
|