About the use of NotNull as a Field Name

In a current project, I get an error “Near NotNull” that will let me (my code, probably) save the five other TABLEs, but not the TABLE where a Field is named NotNull.

Of course, when I changed that to Not_Null, no error arise.

I suppose that the CREATE TABLE string will hold NotNull NOT NULL and SQLite does not like that.

I searched in both Xojo docs and www.sqlite.com for details of what is illegal (as Field Name), but found nothing.

PS: if the Listbox Column name is a number (say 8 for example), I get the same kind of error (I think).Adding a leading character made the trick: the data base is created and filled. My code create a Field Name automatically, using the Listbox Header String value.

Edit: add a missing space after a dot: this forum software wrongly believed this was an URL ;-:slight_smile:

Sounds like NotNull is a reserved word.

Yup. Listed in their keywords:

http://www.sqlite.com/lang_keywords.html

I do not saw that page. I have to remember it for (eventual) future checkings.

I searched for Field Name Syntax or so, and I forgot reserved words / keywords…

Thank you Greg.

So, if one use the Listbox Header Strings as Column Field Names, better check the 124 (as of today) language Keywords.

What is mandatory have to be done. :frowning:

[quote=339762:@Emile Schwarz]I do not saw that page. I have to remember it for (eventual) future checkings.

I searched for Field Name Syntax or so, and I forgot reserved words / keywords…

Thank you Greg.[/quote]
All I did was type “NotNull” into their search field.

[quote=339763:@Emile Schwarz]So, if one use the Listbox Header Strings as Column Field Names, better check the 124 (as of today) language Keywords.

What is mandatory have to be done. :([/quote]
and if you use postgres, or mysql the keywords are not exactly the same…