Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Can't use "TimeStamp NULL" or "Date NULL" - Syntax Error
Mon, Nov 25 2013 12:01 PMPermanent Link

Barry

I'm not sure I'd call this a bug or not. Maybe it is an ANSI syntax that IMHO needs to be changed.

This works fine (of course):
update company set start_date = date '2013-01-01' where pl_id=1

But if I try something like:
update company set start_date = date NULL where pl_id=1

I get an error message:
"ElevateDB Error #700 An error was found in the statement at line 1 and column 38 (Expected date constant but instead found NULL)"

This complicates things because the rtn that puts this SQL statement together will now have to determine if the Date (or TimeStamp) value is NULL, and if it is, it will have to drop the keyword "Date" (or "TimeStamp").

I don't see the need for this. Why can't "Date NULL" (or "TimeStamp NULL") be interpreted as NULL?

TIA
Barry
Wed, Nov 27 2013 10:59 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Barry,

<< I don't see the need for this. Why can't "Date NULL" (or "TimeStamp
NULL") be interpreted as NULL? >>

It's just not how the SQL data types/constants work - NULL is always just
NULL, and there isn't any such thing as DATE NULL, etc.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Nov 27 2013 11:06 AMPermanent Link

Barry

>It's just not how the SQL data types/constants work - NULL is always just
NULL, and there isn't any such thing as DATE NULL, etc.<

Tim,

I thought that applying any operator to a NULL value will result in a NULL value?

Instead I get a syntax error.

Barry
Mon, Dec 2 2013 2:28 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Barry,

<< I thought that applying any operator to a NULL value will result in a
NULL value? >>

I assume that this is a different question ?  If so, then yes, that is
correct.

<< Instead I get a syntax error. >>

SQL ?

Tim Young
Elevate Software
www.elevatesoft.com
Image