views:

21

answers:

2

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?

+1  A: 

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

eiefai
That was it. The Null is not allowed.By the way...I also learned that you can't name a field Active without delimiting with quotes.Seth
Seth Spearman
A: 

Null is not allowed butr by default it's null

You can take a look at this grammar

Hugues Van Landeghem