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 » WMB 7 - EVAL function

Post new topic  Reply to topic
 WMB 7 - EVAL function « View previous topic :: View next topic » 
Author Message
scravr
PostPosted: Wed Apr 06, 2011 1:02 pm    Post subject: WMB 7 - EVAL function Reply with quote

Partisan

Joined: 03 Apr 2003
Posts: 391
Location: NY NY USA 10021

Puting these lines into EVAL function always get following error

This is the string to EVAL:
If (CfgSrvRef.SubscriberId = 'RCDC02_CASH_PAYMENT_V100') Then
Return True;
Else Return False;
End If;


This is the error I am getting.

RecoverableException
File:CHARACTER:F:\build\S700_P\src\DataFlowEngine\ImbRdl\ImbRdlRdp.cpp
Line:INTEGER:355
Function:CHARACTER:SqlParser::parseExpression
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:TestFilter#FCMComposite_1_8
Label:CHARACTER:TestFilter.Compute
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2402
Text:CHARACTER:Expected end of file
Insert
Type:INTEGER:5
Text:CHARACTER:
Insert
Type:INTEGER:5
Text:CHARACTER:2.5
Insert
Type:INTEGER:5
Text:CHARACTER:keyword Then



same error when I put the "Then" on second line like:
If (CfgSrvRef.SubscriberId = 'RCDC02_CASH_PAYMENT_V100')
Then
...
...
...


Can EVAL work with "Then" ?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
mgk
PostPosted: Wed Apr 06, 2011 1:51 pm    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

First, are you aware there are two versions of EVAL? The first is the EVAL function, which can only "evaluate" expressions, and the EVAL statement which can only "evaluate" one or more statements. In this case it would appear you need to be using the statement version. If you are, can you post the actual ESQL that contains the EVAL please...

Kind 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
MrSmith
PostPosted: Thu Apr 07, 2011 2:14 am    Post subject: Reply with quote

Master

Joined: 20 Mar 2008
Posts: 215

could you also add what node you are doing the evaluation in as your syntax may be incorrect for that particular node (i.e filter v compute)
Back to top
View user's profile Send private message
scravr
PostPosted: Thu Apr 07, 2011 4:31 am    Post subject: Reply with quote

Partisan

Joined: 03 Apr 2003
Posts: 391
Location: NY NY USA 10021

This is on 7.0.0.1

In ESQL Compute node: the following 4 ESQL lines are SELECT from a database into Env. Var. named CfgSrvRef.FilterCode:

If (CfgSrvRef.SubscriberId = 'RCDC02_CASH_PAYMENT_V100') Then
Return True;
Else Return False;
End If;



Then if we got something from DB, we EVAL the lines and like to get True or False:
...
...
...
Declare rtVal Boolean False;
...
...
...
IF CfgSrvRef.FilterCode IS NOT NULL THEN
Set rtVal = EVAL(CfgSrvRef.FilterCode);
If (rtVal = False) Then -- this may neve execute since we already return in EVAL
Return False;
End If;
END IF;
...
...
...
Return True;






This is the error I am getting.

RecoverableException
File:CHARACTER:F:\build\S700_P\src\DataFlowEngine\ImbRdl\ImbRdlRdp.cpp
Line:INTEGER:355
Function:CHARACTER:SqlParser::parseExpression
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:TestFilter#FCMComposite_1_8
Label:CHARACTER:TestFilter.Compute
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2402
Text:CHARACTER:Expected end of file
Insert
Type:INTEGER:5
Text:CHARACTER:
Insert
Type:INTEGER:5
Text:CHARACTER:2.5
Insert
Type:INTEGER:5
Text:CHARACTER:keyword Then
Back to top
View user's profile Send private message Send e-mail MSN Messenger
mgk
PostPosted: Thu Apr 07, 2011 5:24 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

So code uses the EVAL function:

Code:
Set rtVal = EVAL(CfgSrvRef.FilterCode);


But the code you are EVALing is a statement (IF) so you must use the EVAL statement, which does not return a value like this:

Code:
EVAL(CfgSrvRef.FilterCode);


Kind 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
gechu
PostPosted: Wed May 25, 2011 6:43 am    Post subject: Reply with quote

Apprentice

Joined: 27 Feb 2008
Posts: 48

I´m stuck here as well.

The function transportVIDB returns a boolean.

Code:

-- dummy code to force the compiler to include a function which only will be run via an EVAL function..
IF (FALSE) THEN CALL transportVIDB(InputLocalEnvironment, InputLocalEnvironment) INTO InputLocalEnvironment.temp; END IF;


DECLARE functionStr CHARACTER 'CALL ' || transportAfterMQ || '(messageListMsgRef, InputLocalEnvironment)';
--> CALL transportVIDB(messageListMsgRef, InputLocalEnvironment);
      
DECLARE myBooleanVar BOOLEAN;
SET myBooleanVar = EVAL(functionStr);


I get the same error: Expected end of file.

I´ve read that EVAL can only return a single scalar value representable in character. A boolean value I assume fits that description.

Why does this code above fail?

Thanks!
Back to top
View user's profile Send private message
gechu
PostPosted: Wed May 25, 2011 6:50 am    Post subject: Reply with quote

Apprentice

Joined: 27 Feb 2008
Posts: 48

Found the answer myself.

when I call my function using EVAL I should not include the "CALL" part in the code. Here is a BAD example:

DECLARE myBool = EVAL('CALL myFunction(param)');

and the good one:
DECLARE myBool = EVAL('myFunction(param)');

Didn´t try the code, but I hope you get the point.

/Erik
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 » WMB 7 - EVAL function
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.