Subject Re: [ib-support] null vs not null field syntax?
Author Helen Borrie
At 12:53 PM 28-02-02 +0000, you wrote:
>Platform: Firebird RC2
>
>Hello all!
>
>Been working to finally getting to the latest firebird, etc, and came
>across some code in a code library that basically issued the
>statement: (pseudocode)

-- this is standard (all columns are nullable unless declared otherwise)

>CREATE TABLE(FieldName VARCHAR(80) not null,

-- this is not:

>FieldName2 VARCHAR(30)
>null);

Did Firebird allow this? it should chuck up:

ISC ERROR CODE:335544569

ISC ERROR MESSAGE:
Dynamic SQL Error
SQL error code = -104
Token unknown - line 4, char 20
null

(as it did on my RC2)


>Firebird was dying on the "not null" part of the statement.

It won't die on NOT NULL. It should have died on what came after. What
was the error message you got?

> And whoever put it into the code library had the note: "SQL-92 Standard?"

Possibly an ex-MSSQL programmer who thinks MSSQL is standard.

>I started to look through the spec and just got glazed over rather
>quickly and never found whether "not null" is part of the spec. So
>what I'm asking is:
>
>1 - Do any of your SQL-92 gurus know whether it is or it isn't?

NOT NULL is regarded by the SQL committee as a constraint, according to my
Melton & Simon book on the the SQL-92 standard. Enforcing non-nullability
by default and applying nullability as a "constraint" is contrary.


>2 - If it is, is it worthwhile to report it as a conformance bug?

LOL, give Diane B. a chance to quote the standard first.

Helen


All for Open and Open for All
Firebird Open SQL Database ยท http://firebirdsql.org
_______________________________________________________