|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
EVAL with If Condition |
« View previous topic :: View next topic » |
Author |
Message
|
kirankinnu |
Posted: Fri Jan 22, 2010 8:17 am Post subject: EVAL with If Condition |
|
|
 Centurion
Joined: 12 Jun 2004 Posts: 128 Location: Chicago, IL
|
Hi Folks,
I am having some coding difficulty. Maybe someone could point out how to handle this.
We have a dynamic Condition that keeps changing. I should evaluate the condition and return If its true or false. I am using EVAL for this. So here is am example
SET X = '(A>B)'
SET R = EVAL(X);
The above EVAL Should return TRUE if A>B or else return FALSE. A, B are dynamic XPATH's and will keep changing. The Condition also will change, Like we can expect A<B or A=B..
We are getting 'Error Evaluating Expression' When I use the above logic. Can we use EVAL function or Statement of IF condition.
How can we handle the above scenario. I would appreciate any solution or workaround.
Thank you,
Kiran |
|
Back to top |
|
 |
broker_new |
Posted: Fri Jan 22, 2010 8:56 am Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
I am not 100 % sure but try using "{" "}" for dynamically changing fields and see what happens. _________________ IBM ->Let's build a smarter planet |
|
Back to top |
|
 |
kirankinnu |
Posted: Fri Jan 22, 2010 9:00 am Post subject: |
|
|
 Centurion
Joined: 12 Jun 2004 Posts: 128 Location: Chicago, IL
|
No use with using { }..It gives a Syntax Error while Evaluating the expression |
|
Back to top |
|
 |
mgk |
Posted: Fri Jan 22, 2010 9:56 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Can you provide an actual example of the ESQL you are using that fails, along with an example of the dynamic expression you are using?
Note that the EVAL function can only eval expressions, while the EVAL statement can only eval statements. As IF is a statement, you need to use the EVAL statement to eval an IF
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 |
|
 |
kirankinnu |
Posted: Fri Jan 22, 2010 11:16 am Post subject: |
|
|
 Centurion
Joined: 12 Jun 2004 Posts: 128 Location: Chicago, IL
|
The EVAL statement did the trick. I was using EVAL as function and was getting errors while executing.
Thank you for the Support
Regards,
Kiran |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|