Author |
Message
|
mehedih |
Posted: Mon Nov 12, 2001 10:15 am Post subject: |
|
|
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 |
|
 |
bh |
Posted: Mon Nov 12, 2001 10:24 am Post subject: |
|
|
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 |
|
 |
mehedih |
Posted: Mon Nov 12, 2001 10:34 am Post subject: |
|
|
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 |
|
 |
Armin |
Posted: Mon Nov 12, 2001 10:54 am Post subject: |
|
|
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 |
|
 |
mehedih |
Posted: Mon Nov 12, 2001 11:10 am Post subject: |
|
|
Newbie
Joined: 11 Nov 2001 Posts: 5 Location: PSTech
|
Thanks ARMIN you are the greatest |
|
Back to top |
|
 |
Tibor |
Posted: Tue Nov 13, 2001 12:37 am Post subject: |
|
|
 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 |
|
 |
|