Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 8 of 8 total |
CAST error |
Thu, Apr 12 2007 2:17 PM | Permanent Link |
"Ole Willy Tuv" | Executing the following query in EDB Manager:
select cast(current_time as timestamp) from dummy Error: '0.66348709' is not a valid timestamp. I'm not able to close the error dialog, it keeps popping up, and I need to kill the application in the task manager. The following expression: cast(cast(current_time as timestamp) as varchar(24)) executes fine and returns a timestamp string with a correct time part, but with the date part incorrectly set to 0000-00-00. To my knowledge, a cast from DATE to TMESTAMP should set the date part to the current date and the time part to the source value. Ole Willy Tuv |
Thu, Apr 12 2007 3:38 PM | Permanent Link |
"Ole Willy Tuv" | << To my knowledge, a cast from DATE to TMESTAMP should set the date part to
the current date and the time part to the source value. >> TMESTAMP is a short hand for TIMESTAMP Ole Willy Tuv |
Thu, Apr 12 2007 4:07 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Ole,
<< Executing the following query in EDB Manager: select cast(current_time as timestamp) from dummy Error: '0.66348709' is not a valid timestamp. I'm not able to close the error dialog, it keeps popping up, and I need to kill the application in the task manager.>> It's that silly Delphi 6 and higher issue with having a zero date value in a TTimeStamp structure. I'll see what I can do about working around it. << The following expression: cast(cast(current_time as timestamp) as varchar(24)) executes fine and returns a timestamp string with a correct time part, but with the date part incorrectly set to 0000-00-00. To my knowledge, a cast from DATE to TMESTAMP should set the date part to the current date and the time part to the source value. >> Frankly, I have no idea, but what you suggest sounds fine to me. -- Tim Young Elevate Software www.elevatesoft.com |
Thu, Apr 12 2007 4:07 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Ole,
<< TMESTAMP is a short hand for TIMESTAMP >> I also assumed that DATE to TIMESTAMP was short-hand for TIME to TIMESTAMP. -- Tim Young Elevate Software www.elevatesoft.com |
Thu, Apr 12 2007 4:22 PM | Permanent Link |
"Ole Willy Tuv" | Tim,
<< Frankly, I have no idea, but what you suggest sounds fine to me. >> Good, since it's both the SQL specifaction (ref. 6.12 <cast specification>) and the common industry behavior. It also makes sense, since a TIMESTAMP with a date part of 0000-00-00 is an invalid TIMESTAMP value, as opposed to the current date which makes the TIMESTAMP a valid value. Ole Willy Tuv |
Thu, Apr 12 2007 5:42 PM | Permanent Link |
"Ole Willy Tuv" | Tim,
<< I also assumed that DATE to TIMESTAMP was short-hand for TIME to TIMESTAMP. >> hm.. fuzzy short-hand, yes Ole Willy Tuv |
Thu, Apr 12 2007 7:00 PM | Permanent Link |
"Ole Willy Tuv" | Tim,
<< It's that silly Delphi 6 and higher issue with having a zero date value in a TTimeStamp structure. I'll see what I can do about working around it. >> Thinking about it - I guess that you don't have to work around it if you set the correct value, i.e. the current date instead of 0, when evaluating this expression. The basic problem is the invalid 0 date, I'd guess. Ole Willy Tuv |
Sat, Apr 14 2007 3:07 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Ole,
<< The basic problem is the invalid 0 date, I'd guess. >> Yep. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Sunday, May 19, 2024 at 08:46 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |