Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 6 of 6 total |
SQL Manual, documentation of NULL |
Thu, Mar 22 2007 1:30 PM | Permanent Link |
"Ole Willy Tuv" | Tim,
From the SQL Manual: <quote> Definition of a NULL NULL is the term used in the SQL standard and database management systems to describe a value that is not known. It is important to distinguish that while a NULL is an unknown value, it does still have a type. There is no such thing as a unknown value that also has an unknown type. </quote> While the keyword NULL is used in SQL to specify the null value, it's *not* associated with a data type, except for contextually typed value specifications. This is why SQL can use a single keyword, instead of defining a separate null keyword for each supported data type. This is also why an explicit cast is needed to associate NULL with a data type in value expressions, for example: select cast(null as integer) from dummy Ole Willy Tuv |
Thu, Mar 22 2007 5:44 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Ole,
<< While the keyword NULL is used in SQL to specify the null value, it's *not* associated with a data type, except for contextually typed value specifications. This is why SQL can use a single keyword, instead of defining a separate null keyword for each supported data type. This is also why an explicit cast is needed to associate NULL with a data ype in value expressions, for example: >> The paragraph was in reference to column values, not the NULL constant, which is the only exception where a NULL value also has an unknown type. -- Tim Young Elevate Software www.elevatesoft.com |
Thu, Mar 22 2007 5:56 PM | Permanent Link |
"Ole Willy Tuv" | Tim,
<< The paragraph was in reference to column values, not the NULL constant, which is the only exception where a NULL value also has an unknown type. >> Yes, but the statement that a value denoted by the NULL keyword always has a data type is confusing, particularly since the opposite is true. Well, it was just a comment. You're the author of the EDB SQL Manual Ole Willy Tuv |
Fri, Mar 23 2007 7:13 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Ole,
<< Yes, but the statement that a value denoted by the NULL keyword always has a data type is confusing, particularly since the opposite is true. >> I'll make a note to add the word "column" to the description. -- Tim Young Elevate Software www.elevatesoft.com |
Sun, Mar 25 2007 8:49 AM | Permanent Link |
"Ole Willy Tuv" | Tim,
<< I'll make a note to add the word "column" to the description. >> Something like the following text might be a more precise documentation of NULL: Definition of the NULL keyword NULL is the term used in the SQL standard and database management systems to describe a value that is not known. It is important to be aware of that the keyword NULL in SQL text does not associate a data type with the null value, except when specified as a contextually typed value specification, where the data type is implicitly derived from the context of the assignment. An explicit cast is needed in general value expressions to associate NULL with a data type. Examples NULL as a value expression: SELECT CAST(NULL AS INTEGER) AS null_expression FROM <table name> NULL as contextually typed value specifications: INSERT INTO <table name> (<column name>) VALUES (NULL); UPDATE <table name> SET <column name> = NULL; Ole Willy Tuv |
Mon, Mar 26 2007 8:47 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Ole,
<< Something like the following text might be a more precise documentation of NULL: >> While I appreciate the input, we're trying to stay away from using the phrasing that the standard uses, mainly because most people won't understand a word of it. Case in point - "contextually typed value specification". Most of the phrasing in the standard requires multiple cross-reference lookups in order to resolve a simple question, and that is not what we want our manuals to be like. It's fine for the standard, because it has to be completely anal. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Friday, September 20, 2024 at 05:39 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |