NOTNULL

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

NOTNULL

R Smith-2
I find the keyword NOTNULL listed among known SQLite keywords -
no. 88 on this page: https://sqlite.org/lang_keywords.html

But cannot find a single mention of it or place to use it in SQLite, nor
get any hit on the sqlite.org search except in reference to the above list.

1. What is it for?

2. Does it have/need any documentation?


_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: NOTNULL

Simon Slavin-3
On 8 Jan 2020, at 11:15am, R Smith <[hidden email]> wrote:

> I find the keyword NOTNULL listed among known SQLite keywords -
> no. 88 on this page: https://sqlite.org/lang_keywords.html
>
> But cannot find a single mention of it or place to use it in SQLite, nor get any hit on the sqlite.org search except in reference to the above list.
>
> 1. What is it for?
>
> 2. Does it have/need any documentation?

You can use NOTNULL as a condition.  It's the opposite of ISNULL.  You see it usually as a constraint, to ensure that a field has a value.

However, NOT NULL with a space works too, and that version seems to be more popular these days.

CREATE TABLE company (
    code TEXT NOT NULL,
    name TEXT NOT NULL)

You're right.  I don't think I see NOTNULL mentioned anywhere else in the SQLite documentation.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: NOTNULL

R Smith-2

On 2020/01/08 1:23 PM, Simon Slavin wrote:
>
> You can use NOTNULL as a condition.  It's the opposite of ISNULL.  You see it usually as a constraint, to ensure that a field has a value.

Thank you Simon - Do you perhaps have an example of this working in
SQLite? I am not finding a way to make it work.


> However, NOT NULL with a space works too, and that version seems to be more popular these days.

Yes, this I'm using in SQLite often.  I'm busy updating the
documentation functions for the next release of sqlitespeed, needing to
connect every keyword/function to its proper use in SQLite - which is
why I've been posting these documentation-related questions.


Thanks for helping,
Ryan

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: NOTNULL

Keith Medcalf
In reply to this post by R Smith-2

On Wednesday, 8 January, 2020 04:16, R Smith <[hidden email]> wrote:

>I find the keyword NOTNULL listed among known SQLite keywords -
>no. 88 on this page: https://sqlite.org/lang_keywords.html

>But cannot find a single mention of it or place to use it in SQLite, nor
>get any hit on the sqlite.org search except in reference to the above
>list.

>1. What is it for?

It is a common misspelling of "IS NOT NULL" and means the same thing.

"ISNULL" is also a reserved word as it is a common misspelling of "IS NULL" and means the same thing.

You will note that ISNOTNULL is not a reserved word because apparently the common misspellings only omit one or the other of the spaces, butnotboth at the sametime.

Also, ISNOT is not a reserved word.  Apparently it is more common for the misspelling IS NOTNULL to be made than ISNOT NULL, even though ISNOT is the more logical inverse operator to IS.  (Perhaps this is because ISNOT could be spelled as iSnot leading to lawsuits from Apple ... :) )

>2. Does it have/need any documentation?

No.

--
The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume.




_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: NOTNULL

R Smith-2

On 2020/01/08 2:03 PM, Keith Medcalf wrote:
>
>> 1. What is it for?
> It is a common misspelling of "IS NOT NULL" and means the same thing.
>
> "ISNULL" is also a reserved word as it is a common misspelling of "IS NULL" and means the same thing.
>
> You will note that ISNOTNULL is not a reserved word because apparently the common misspellings only omit one or the other of the spaces, butnotboth at the sametime.
>
> Also, ISNOT is not a reserved word.  Apparently it is more common for the misspelling IS NOTNULL to be made than ISNOT NULL, even though ISNOT is the more logical inverse operator to IS.  (Perhaps this is because ISNOT could be spelled as iSnot leading to lawsuits from Apple ... :) )


LOL - I'm quoting you in the docs. :)


Thanks for clarifying,
Cheers!

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: NOTNULL

Richard Hipp-3
In reply to this post by R Smith-2
On 1/8/20, R Smith <[hidden email]> wrote:
> I find the keyword NOTNULL listed among known SQLite keywords -
> no. 88 on this page: https://sqlite.org/lang_keywords.html
>
> But cannot find a single mention of it or place to use it in SQLite, nor
> get any hit on the sqlite.org search except in reference to the above list.
>
> 1. What is it for?
>
> 2. Does it have/need any documentation?

NOTNULL is a postgresql-ism.  It is equivalent to IS NOT NULL.

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: NOTNULL

Luuk
In reply to this post by R Smith-2

On 8-1-2020 12:15, R Smith wrote:

> I find the keyword NOTNULL listed among known SQLite keywords -
> no. 88 on this page: https://sqlite.org/lang_keywords.html
>
> But cannot find a single mention of it or place to use it in SQLite,
> nor get any hit on the sqlite.org search except in reference to the
> above list.
>
> 1. What is it for?
>
> 2. Does it have/need any documentation?
>
(from: https://sqlite.org/changes.html  )


      2001-10-02 (2.0.1)

 1. ....
 2. ...
 3. Extend the expression syntax to support "expr NOT NULL" (with a
    space between the "NOT" and the "NULL") in addition to "expr
    NOTNULL" (with no space).

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users