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 » MQSI - Syntax - ESQL

Post new topic  Reply to topic
 MQSI - Syntax - ESQL « View previous topic :: View next topic » 
Author Message
mehedih
PostPosted: Mon Nov 12, 2001 10:15 am    Post subject: Reply with quote

Newbie

Joined: 11 Nov 2001
Posts: 5
Location: PSTech

Hi All,
I need help with this code.
Somethings missing in the last statement

Here is the ESQL

SET OutputRoot = InputRoot;
DECLARE S CHAR;

IF (InputBody.Message.Complaint.Type = 'Order') THEN
SET S='0';
ELSE
IF (InputBody.Message.Complaint.Type = 'Order') THEN
SET S='D';
ELSE
SET S='X';
END IF;

SET OutputRoot.XML.Message.Admin.ComplaintID=
'COM'||
CAST(
EXTRACT(HOUR FROM CURRENT_TIME)*
EXTRACT(MINUTE FROM CURRENT_TIME)
AS CHARACTER
)||S;

Regards

Mehedi


_________________
Thanks

Mehedi Hashir
mhashir2@hotmail.com

[ This Message was edited by: mehedih on 2001-11-12 10:17 ]
Back to top
View user's profile Send private message Send e-mail MSN Messenger
bh
PostPosted: Mon Nov 12, 2001 10:24 am    Post subject: Reply with quote

Acolyte

Joined: 25 Jun 2001
Posts: 61

Be sure to write your eSQL sentence in a Compute node, and click the radio button 'Copy entire Message'
Then:

SET OutputRoot = InputRoot;
DECLARE S CHAR;

IF (InputBody.Message.Complaint.Type = 'Order') THEN
SET S='0';
ELSE
IF (InputBody.Message.Complaint.Type = 'Order')
-- has to be replace by an other value, Delivery, for instance...
THEN
SET S='D';
ELSE
SET S='X';
END IF;

SET OutputRoot.XML.Message.Admin.ComplaintID=
'COM'||
CAST(
EXTRACT(HOUR FROM CURRENT_TIME)*
EXTRACT(MINUTE FROM CURRENT_TIME)
AS CHARACTER
)||S;

And it should work. What's saying the trace or log ?
Back to top
View user's profile Send private message
mehedih
PostPosted: Mon Nov 12, 2001 10:34 am    Post subject: Reply with quote

Newbie

Joined: 11 Nov 2001
Posts: 5
Location: PSTech

It is the last staement that is causing the
syntax error -

SET OutputRoot.XML.Message.Admin.ComplaintID=
'COM'||
CAST(
EXTRACT(HOUR FROM CURRENT_TIME)*
EXTRACT(MINUTE FROM CURRENT_TIME)
AS CHARACTER
)||S;

Thanks for the effort
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Armin
PostPosted: Mon Nov 12, 2001 10:54 am    Post subject: Reply with quote

Novice

Joined: 24 Jul 2001
Posts: 15
Location: Germany


On 2001-11-12 10:34, mehedih wrote:
It is the last staement that is causing the
syntax error -

The last statement is ok. But an endif is missing in the previous statement. Like

IF (InputBody.Message.Complaint.Type= 'Order') THEN
SET S='0';
ELSE
IF (InputBody.Message.Complaint.Type = 'Order')
-- has to be replace by an other value, Delivery, for instance...
THEN
SET S='D';
ELSE
SET S='X';
END IF;
END IF;
^^^^^^^

Armin
Back to top
View user's profile Send private message
mehedih
PostPosted: Mon Nov 12, 2001 11:10 am    Post subject: Reply with quote

Newbie

Joined: 11 Nov 2001
Posts: 5
Location: PSTech

Thanks ARMIN you are the greatest
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Tibor
PostPosted: Tue Nov 13, 2001 12:37 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

Quote:

IF (InputBody.Message.Complaint.Type= 'Order') THEN
SET S='0';
ELSE
IF (InputBody.Message.Complaint.Type = 'Order')
-- has to be replace by an other value, Delivery, for instance...
THEN
SET S='D';
ELSE
SET S='X';
END IF;
END IF;


Code will be simpler when using CASE expression


SET S = CASE InputBody.Message.Complaint.Type
WHEN 'Order' THEN 'O'
WHEN '...' THEN 'D'
ELSE 'X'
END;
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 » MQSI - Syntax - ESQL
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.