Boolean column in HSQLDB with default value

I'm having trouble getting HSQLDB to create a table with a boolean column. It seems that every time I try to specify a default value, I get an exception:

org.hsqldb.HsqlException: unexpected token: DEFAULT 

I can create this problem even with this trivial table definition:

 CREATE TABLE foo ( bar BOOLEAN NOT NULL DEFAULT FALSE ); 

According to the documentation, I should be able to do this!

See columnDefinition at http://www.hsqldb.org/doc/guide/ch09.html#create_table-section

Am I misunderstood something?

+6
source share
1 answer

From the provided HSQLDB doc, the correct syntax

 CREATE TABLE foo ( bar BOOLEAN DEFAULT FALSE NOT NULL ); 

i.e. Order matters in SQL

+12
source

Source: https://habr.com/ru/post/952521/


All Articles