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 » 'FALSE OR TRUE'. The result was 'FALSE'

Post new topic  Reply to topic
 'FALSE OR TRUE'. The result was 'FALSE' « View previous topic :: View next topic » 
Author Message
csongebalazs
PostPosted: Fri Jan 30, 2004 2:47 am    Post subject: 'FALSE OR TRUE'. The result was 'FALSE' Reply with quote

Voyager

Joined: 30 Jan 2004
Posts: 78

I work with IBM WebSphere MQ Integrator Broker V2.1 for Multiplatforms + CSD05.

In a node there was the following ESQL code:

IF LENGTH(COALESCE(CAST(InputRoot.XML.Root.id AS CHAR), '')) > 10 OR LENGTH(COALESCE(CAST(InputRoot.XML.Root.id AS CHAR), '')) = 0 THEN
SET label = 'mezohiba';
SET Environment.Mezohiba = 'Az id mezo erteke (' || COALESCE(CAST(InputRoot.XML.Root.id AS CHAR), '') || ') nem megfelelo (hossza =0 vagy > 10).';
END IF;

When the InputRoot.XML.Root.id filed was NULL, I saw the following during the user debug trace:

2004-01-30 11:07:31.357000 4420 UserTrace BIP2539I: Node 'PIPE_Huseghitel_folyositas.Kovetkezo_lepes_meghatarozasa': Finished evaluating expression 'LENGTH(COALESCE(CAST(InputRoot.XML.Root.id AS CHARACTER), '')) > 10 OR LENGTH(COALESCE(CAST(InputRoot.XML.Root.id AS CHARACTER), '')) = 0' at (85, 70). This resolved to 'FALSE OR TRUE'. The result was 'FALSE'.
2004-01-30 11:07:31.357000 4420 UserTrace BIP2537I: Node 'PIPE_Huseghitel_folyositas.Kovetkezo_lepes_meghatarozasa': Executing statement 'SET label = 'mezohiba';' at (86, 5).
2004-01-30 11:07:31.357000 4420 UserTrace BIP2537I: Node 'PIPE_Huseghitel_folyositas.Kovetkezo_lepes_meghatarozasa': Executing statement 'SET Environment.Mezohiba = 'Az id mezo erteke (' || COALESCE(CAST(InputRoot.XML.Root.id AS CHARACTER), '') || ') nem megfelelo (hossza =0 vagy > 10).';' at (87, 5).

The first line is VERY INTERESTING !!!
Despite of this, the flow work properly, just the debug file contains this unacceptebale result.

When the InputRoot.XML.Root.id filed was '12345678901', I saw the following in the debug file:

2004-01-30 11:17:10.810000 4420 UserTrace BIP2539I: Node 'PIPE_Huseghitel_folyositas.Kovetkezo_lepes_meghatarozasa': Finished evaluating expression 'LENGTH(COALESCE(CAST(InputRoot.XML.Root.id AS CHARACTER), '')) > 10 OR LENGTH(COALESCE(CAST(InputRoot.XML.Root.id AS CHARACTER), '')) = 0' at (85, 70). This resolved to 'TRUE OR '. The result was 'TRUE'.

It was correct.

Is this a BUG of the user debug trace?
Back to top
View user's profile Send private message
JLRowe
PostPosted: Fri Jan 30, 2004 7:38 am    Post subject: Reply with quote

Yatiri

Joined: 25 May 2002
Posts: 664
Location: South East London

It's just a shortcut optimisation performed by the ESQL virtual machine (or whatever it's called). Since the first operand of the OR is TRUE, there is no point evaluating the second.

It'll do the samething with AND, if the first operand is FALSE, it'll skip the evaluation of the second since the result will always be FALSE.
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Tue Feb 03, 2004 1:57 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
This resolved to 'FALSE OR TRUE'. The result was 'FALSE'.


...but 'FALSE OR TRUE' should evaluate to 'TRUE', with or without short-circuit evaluation!
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Feb 03, 2004 6:12 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Put in more parentheses.

(LENGTH(...)>10 ) OR (LENGTH(...)=0)
_________________
I am *not* the model of the modern major general.
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 » 'FALSE OR TRUE'. The result was 'FALSE'
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.