Can you define a NULL on a column definition in the Create Table statement in a Firebird DB?

StackOverflow https://stackoverflow.com/questions/3364344

  •  04-10-2020
  •  | 
  •  

문제

I am using SQL Manager Lite to try to run a DDL Create Table script. I am new to Firebird and I don't know why it isn't working. The following script...

create table Contacts (
    ID                      integer            not null,
    FirstName               varchar(64)        not null,
    LastName                varchar(64)        not null,
    MiddleInitial           varchar(1)             null
);

Is causing a parsing error (UNIDENTIFIED TOKEN) on the null constraint for the MiddleInitial column.

Here is the exact error returned by Sql Lite...

Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 5, column 52.
Null.

Is the NULL constraint not allowed in Create Table DDL for firebird?

도움이 되었습니까?

해결책

not sure if ti works as I can't test it right now but try removing null from the sentence:

CREATE TABLE Contacts(
    Id integer not null,
    First_Name varchar(64) not null,
    Last_Name varchar(64) not null,
    Middle_Initial varchar(1)
);

See this link: Firebird Wiki

다른 팁

Null is not allowed butr by default it's null

You can take a look at this grammar

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top