Posted: Fri Jun 29, 2012 7:38 am Post subject: Problem CASTing timestamp string to ESQL TIMESTAMP variable
Newbie
Joined: 29 Jun 2012 Posts: 2
I'm trying to read a timestamp value that is stored as so: 201205230858220 and cast it to a TIMESTAMP variable in ESQL, but I keep getting an invalid date error.
The ESQL looks like this:
DECLARE TS TIMESTAMP CAST(InputRoot.XMLNSC.TestInput.DateTimeValue AS TIMESTAMP FORMAT 'yyyyMMddHHMMssS');
The result is "Error 2521"... "Error while casting"... "Invalid date"... etc.
If I change the input string to "2012-05-23T08:58:22.0" and change the line of code like so:
DECLARE TS TIMESTAMP CAST(InputRoot.XMLNSC.TestInput.DateTimeValue AS TIMESTAMP FORMAT 'I');
Then it works... The only format I can get to work is the "I" format (which requires me to add coding to manually reformat the input string). Is there something I'm missing? How do I get the other custom format strings to work? There's nothing that I can see in the documentation that says my first line of code shouldn't work... Is this a bug in WMB?
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