Hi Gurus,
I am trying to give a range of values to one data item based on value of another data item.
code
e.g.
case
when (abc = '123')) Then (cc in ('a','b','c','d'))
END
if I tried using if...but I keep getting parsing error.
QE-DEF-0459 CCLException
QE-DEF-0260 Parsing error before or near position: 42 of: "case
what am I doing wrong?
My usual debugging technique is to throw random letters inside of each part of my filter/query to pinpoint exactly where the error is occurring, due to counting the number of characters can be tedious.
I'm thinking it is missing the ELSE statement. Also not sure if you can use 'in' within the Then statement, but someone can prove me wrong on that.
Are you trying to create a filter expression? Is this a relational package?
If yes to both, then you should avoid a case statement and stick with something that evaluates to true or false.
(
[abc] = '123'
and
[cc] in ('a','b','c','d')
)
If you have more conditions, you can expand with "or" between the blocks
(
[abc] = '123'
and
[cc] in ('a','b','c','d')
)
or
(
[abc] = '456'
and
[cc] in ('w','x','y','z')
)
Hi Lynn,
Thanks a lot for the detailed reply. Yes to both. Will try out the method.
Regards,
Venkat