|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
WMBIMB 5 - Eval statements |
« View previous topic :: View next topic » |
Author |
Message
|
mehedi |
Posted: Tue Mar 01, 2005 8:30 am Post subject: WMBIMB 5 - Eval statements |
|
|
Centurion
Joined: 11 Nov 2001 Posts: 102 Location: PSTech
|
Hi folks
The piece of code is flagged as having syntax errors in the Message Broker Toolkit. This code works fine in MQSI 2.1.The specific line flagged is the SET statement.
I did notice some earlier post's on the same topic "problem with
EVAL statements while migrating from MQSI 2.1 to WBIMB 5".
There was no indication on how this is to be resolved
WHILE EVAL( 'FIELDNAME(' || Path || ') IS NOT NULL') DO
IF EVAL('FIELDNAME(' || Path || '.*[LAST])') <> 'Text' THEN
IF EVAL('FIELDNAME(' || Path || '.Severity) IS NOT NULL') THEN
SET OutputRoot.IBC_EHDR.ErrorSeverity = EVAL(Path || '.Severity');
END IF;
END IF;
END WHILE;
Thanks
Mehedi |
|
Back to top |
|
 |
Craig B |
Posted: Tue Mar 01, 2005 10:22 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
Hi,
I seem to recall that the problem is with the variable name Path since ESQL now has a PATH variable. I was under the impression this was fixed in a later fix pack. You should be able to resolve your problem by changing your Path scalar variable to a different name such as ErrorPath.
It should be noted that the ESQL you are using use EVAL statements that do not perform very well. Every EVAL statement is like having another conpute node in your message flow. The ESQL seems to be the old sample ESQL for navigating an ExceptionList. You may wish to consider the following sample ESQL for navigating generic message trees :
Code: |
DECLARE foundMatch BOOLEAN;
SET foundMatch = FALSE;
CALL navigate (ExceptionList, foundMatch, 'Text', 'text to search for');
RETURN foundMatch;
CREATE PROCEDURE navigate (IN root REFERENCE, INOUT foundMatch BOOLEAN, IN searchField CHAR, IN searchText CHAR)
BEGIN
DECLARE LookFor CHARACTER;
DECLARE MatchingPattern CHARACTER;
DECLARE cursor REFERENCE TO root;
SET MatchingPattern = FIELDNAME(root);
MOVE cursor FIRSTCHILD;
IF LASTMOVE(cursor) THEN
ELSE
IF MatchingPattern = searchField THEN
IF CAST(root AS CHARACTER) = searchText THEN
SET foundMatch = TRUE;
END IF;
END IF;
END IF;
WHILE LASTMOVE(cursor) AND (foundMatch = FALSE) DO
CALL navigate(cursor, foundMatch, searchField, searchText);
MOVE cursor NEXTSIBLING;
END WHILE;
END;
|
This ESQL is intended to be used in a filter node, to navigate to a specific field name, and search for specific text. You can modify this for what your ExceptionList processing needs.
Hope this helps. _________________ Regards
Craig |
|
Back to top |
|
 |
mehedi |
Posted: Wed Mar 02, 2005 6:31 am Post subject: |
|
|
Centurion
Joined: 11 Nov 2001 Posts: 102 Location: PSTech
|
Craig,
Renamed the variable 'PATH' and things worked fine there on.
Will be looking into replacing the eval statements too.
Thanks for all
Mehedi |
|
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
|
|
|
|