Subject RE: [Firebird-general] Problems with NULL
Author Marc Geldon
and why does it work with mySQL NULL = NULL but NULL + 1 = 0!


-----Original Message-----
From: Paul Beach [mailto:pabeach@...]
Sent: Thu 11.12.2003 15:55
To: Firebird-general@yahoogroups.com
Cc:
Subject: Re: [Firebird-general] Problems with NULL



> I have a problem with "NULL". If I run a statement like SELECT CAST(NULL AS
INTEGER)+1 AS NUMMER FROM WHATEVER the result is NULL!
>
> That's a problem. I had a SQL which was running on mySQL. Some sort of:
>
> INSERT INTO WHATEVER (NUMBER, USER)
> SELECT (MAX(NUMBER)+1) AS NUMBER,
> "a name" AS USER FROM WHATEVER
>
> In mySQL it worked very well. In FB not! He tells me something about datatype
not known and so on. Also a CAST AS INTEGER does not work. How can I convert
this NULL into a 0?

You don't - as per the SQL standard NULL=NULL=NULL

Regards
Paul



Community email addresses:
Post message: Firebird-general@yahoogroups.com
Subscribe: Firebird-general-subscribe@yahoogroups.com
Unsubscribe: Firebird-general-unsubscribe@yahoogroups.com
List owner: Firebird-general-owner@yahoogroups.com

Shortcut URL to this page:
http://www.yahoogroups.com/community/Firebird-general

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/






[Non-text portions of this message have been removed]