|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Trying to substract two time stamp values |
« View previous topic :: View next topic » |
Author |
Message
|
Poli091987 |
Posted: Wed Feb 06, 2013 5:50 am Post subject: Trying to substract two time stamp values |
|
|
Novice
Joined: 10 Dec 2012 Posts: 16
|
iam trying to subtract to time stamp values but getting a error.
DECLARE CurrentDate CHARACTER;
SET CurrentDate = CAST(CURRENT_TIMESTAMP AS CHARACTER FORMAT 'yyyy-MM-dd-HH.mm.ss.SSSSSS');
SET Environment.OutDateTime = CurrentDate;
DECLARE Exacttime FLOAT;
SET Exacttime = Environment.InDateTime - Environment.OutDateTime;
In this Environment.InDateTime is already has a value which was captured in the previous node .
==============================================
getting below error
<detail>
<Text>BIP2230E: Error detected whilst processing a message in node 'ebip_ent_plm_product_service_G2.Compute1'.
The message broker detected an error whilst processing a message in node 'ebip_ent_plm_product_service_G2.Compute1'. An exception has been thrown to cut short the processing of the message.
See the following messages for details of the error. : /build/slot1/S800_P/src/DataFlowEngine/ImbComputeNode.cpp: 497: ImbComputeNode::evaluate: ComIbmComputeNode: ebip_ent_plm_product_service_G2#FCMComposite_1_17
BIP2488E: ('.ebip_ent_plm_product_service_G2_Compute1.Main', '12.3') Error detected whilst executing the SQL statement ''SET Exacttime = Environment.InDateTime - Environment.OutDateTime;''.
The message broker detected an error whilst executing the given statement. An exception has been thrown to cut short the SQL program.
See the following messages for details of the error. : /build/slot1/S800_P/src/DataFlowEngine/ImbRdl/ImbRdlStatementGroup.cpp: 666: SqlStatementGroup::execute: :
BIP2439E: ('.ebip_ent_plm_product_service_G2_Compute1.Main', '12.42') : Error evaluating expression ''Environment.InDateTime - Environment.OutDateTime''.
An error occurred while evaluating an expression. Subsequent messages will contain more information about the nature of the error.
Correct the syntax of your ESQL expression in node ''.ebip_ent_plm_product_service_G2_Compute1.Main'', around line and column ''12.42'', then redeploy the message flow: Ensure that the expression is correctly formed. : /build/slot1/S800_P/src/DataFlowEngine/ImbRdl/ImbRdlBinaryExpression.cpp: 214: SqlBinaryMinus::evaluate: :
BIP2426E: Interval qualifier required for subtraction between values ''TIMESTAMP '2013-02-06 14:01:55.678918''' and ''TIMESTAMP '2013-02-06 14:02:12.107074'''.
When two datetime values are subtracted, an interval qualifier must be given. The subtraction was being performed between values ''TIMESTAMP '2013-02-06 14:01:55.678918''' and ''TIMESTAMP '2013-02-06 14:02:12.107074'''.
Ensure that a valid interval qualifier is specified. : /build/slot1/S800_P/src/DataFlowEngine/ImbRdl/ImbRdlValueOperations.cpp: 1334: ValueOperations::qualifierExpected: :</Text>
</detail>
</soapenv:Fault> |
|
Back to top |
|
 |
McueMart |
Posted: Wed Feb 06, 2013 5:52 am Post subject: |
|
|
 Chevalier
Joined: 29 Nov 2011 Posts: 490 Location: UK...somewhere
|
You are trying to subtract , i.e. the mathematical '-' operation, on two CHARACTER fields. Can you not see what the problem with this might be? |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Feb 06, 2013 5:56 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Aside from McueMart's valid point, the subtraction of two date, time, or timestamp fields is an INTERVAL. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Wed Feb 06, 2013 6:07 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Code: |
SET Environment.Variables.XMLNSC.{ReplyId}.<flowname>.StartTime = CURRENT_GMTTIMESTAMP;
...
SET Environment.Variables.XMLNSC.{ReplyId}.<flowname>.EndTime = CURRENT_GMTTIMESTAMP;
SET Environment.Variables.XMLNSC.{ReplyId}.<flowname>.ElapsedTime = ( CAST ( Environment.Variables.XMLNSC.{ReplyId}.<flowname>.EndTime AS TIME ) - CAST ( Environment.Variables.XMLNSC.{ReplyId}.<flowname>.StartTime AS TIME )) SECOND;
|
_________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
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
|
|
|
|