Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 5 of 5 total |
1.02 b1 - interval issues |
Thu, Apr 12 2007 12:45 PM | Permanent Link |
"Ole Willy Tuv" | select
cast((current_date-date'2000-01-01') as integer) issue1, cast((current_date-timestamp'2000-01-01 00:00:00') year as integer) issue2 from dummy Issue1: EDB executes the ambiguous expression (current_date-date'2000-01-01') without a complaint and returns a DAY interval. Since the result of subtracting a datetime value from a datetime value can be any valid interval, an interval qualifier is required in such expressions. The correct syntax is: ( <datetime value expression> - <datetime term> ) <interval qualifier> Valid intervals when casted to integer would be any single field interval: YEAR MONTH DAY HOUR MINUTE SECOND MSECOND (EDB extension) Issue2: The expression (current_date-timestamp'2000-01-01 00:00:00') is invalid, since the the two operands are not comparable (they have different datetime fields). EDB executes the expression without a complaint, but returns the null value. The engine should raise a proper exception here. Ole Willy Tuv |
Thu, Apr 12 2007 3:45 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Ole,
<< EDB executes the ambiguous expression (current_date-date'2000-01-01') without a complaint and returns a DAY interval. Since the result of subtracting a datetime value from a datetime value can be any valid interval, an interval qualifier is required in such expressions. >> This is intentional to make it easier for DBISAM migration. << The expression (current_date-timestamp'2000-01-01 00:00:00') is invalid, since the the two operands are not comparable (they have different datetime fields). EDB executes the expression without a complaint, but returns the null value. The engine should raise a proper exception here. >> I'm checking this one out this evening. -- Tim Young Elevate Software www.elevatesoft.com |
Thu, Apr 12 2007 3:50 PM | Permanent Link |
"Ole Willy Tuv" | Tim,
<< I'm checking this one out this evening. >> I understand, but it doesn't make the expression less ambiguous. I think you'll be better off in the end by removing this kind of ambiguity from EDB. Ole Willy Tuv |
Thu, Apr 12 2007 4:40 PM | Permanent Link |
"Ole Willy Tuv" | Tim,
<<< I'm checking this one out this evening. >>> << I understand, but it doesn't make the expression less ambiguous. >> Sorry, I quoted the wrong part of your post. I was actually responding to: <<This is intentional to make it easier for DBISAM migration.>> Ole Willy Tuv |
Sat, Apr 14 2007 3:37 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Ole,
<< Sorry, I quoted the wrong part of your post. >> I knew what you meant. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, September 17, 2024 at 04:19 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |