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 EVAL function question

Post new topic  Reply to topic
 ESQL EVAL function question « View previous topic :: View next topic » 
Author Message
careboy
PostPosted: Thu Nov 22, 2012 3:28 am    Post subject: ESQL EVAL function question Reply with quote

Novice

Joined: 15 Jan 2006
Posts: 10

Hi,

Is there a way to execute the following ESQL EVAL function ?

String a = "IF X == '1' THEN SET Y = X+1;"

EVAL(a);


If so, can EVAL supports nested IF statement ?

-Lee
Back to top
View user's profile Send private message
Esa
PostPosted: Thu Nov 22, 2012 3:51 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

No.

I don't think you can execute invalid ESQL even with EVAL, if that's what you asked.
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Thu Nov 22, 2012 4:10 am    Post subject: Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

besides the syntax errors ... from my experience :

EVAL is considered to be slow.

EVAL can fail during runtime, because FUNCTIONS/PROCEDURES used within the EVAL-String are not flattened/'linked in during compile time'/'creation of the bar-file'. Which can lead to problems in production. Since I basically don't use EVAL this is just what a collegue sitting next to me was cursing about once (a production incident because of that something required by EVAL was missing, because it didn't/wasn't linked in during compile).

But that was't (exactly) what you have been asking
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
Esa
PostPosted: Thu Nov 22, 2012 5:01 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

@careboy: I think you should review your design. It seems you are trying to make a simple task way too dynamic.
Back to top
View user's profile Send private message
kash3338
PostPosted: Thu Nov 22, 2012 9:38 pm    Post subject: Re: ESQL EVAL function question Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

careboy wrote:
Is there a way to execute the following ESQL EVAL function ?

String a = "IF X == '1' THEN SET Y = X+1;"

EVAL(a);


Can you please let us know your actual requirement? On seeing this above sample, there is really no use of going for a EVAL function call.
Back to top
View user's profile Send private message Send e-mail
careboy
PostPosted: Tue Nov 27, 2012 8:07 pm    Post subject: Reply with quote

Novice

Joined: 15 Jan 2006
Posts: 10

It may sounds making a simple solution too complex.

There are 2 parts of statement in the ESQL, i.e. the boolean expression (eg X == 1) and assignment statements (eg Y = X + 1).

We are trying to remove dependencies of flow orchestration logic, whereby the statements, ie. boolean expression is returned from another applications and assignment statements are derived from another external applications.
Back to top
View user's profile Send private message
Esa
PostPosted: Wed Nov 28, 2012 5:02 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

careboy wrote:

We are trying to remove dependencies of flow orchestration logic, whereby the statements, ie. boolean expression is returned from another applications and assignment statements are derived from another external applications.


Sounds like you guys are a bunch of J2EE developers...
Back to top
View user's profile Send private message
Esa
PostPosted: Thu Nov 29, 2012 1:30 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

No, I'm sorry if that insulted you.

If you were J2EE developers, you would not be asking questions about ESQL. And you would not be asking questions on mqseries.net. You would already have found a set of open source libraries that would help you to externalize the rules for incrementing your loop counters.

Yes, that is what your first example looks like, externalizing the dependencies between loops and their counters. Which is absurd. But as a great fan of Monty Pythons I take special interest in all kinds of absurdities.

Quote:
We are trying to remove dependencies of flow orchestration logic, whereby the statements, ie. boolean expression is returned from another applications and assignment statements are derived from another external applications.


Please provide us with a better example. That would greatly help us to take your problem more seriously.

If you are trying to do something like this:
Code:
'IF flowName = ''A'' ' || ' THEN ' || 'PROPAGATE TO LABEL ''A'''

it's as absurd as externalizing business logic like this
Code:
'IF country = ''Finland'' AND date > 1.1.2013' || ' THEN ' || 'SET VAT = 0.24'


Well, the examples are not absurd as such, they only become absurd if you extract the conditions and the statements from separate sources. That opens a window for the wildest scenarios...

Are you sure you are doing the right thing?
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 » ESQL EVAL function question
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.