Try the following script:
CREATE TABLE x (i INT); ALTER TABLE x ALTER COLUMN i BIGINT NOT NULL;
According to the documentation, the above should be perfectly fine
http://www.hsqldb.org/doc/guide/ch09.html#alter_table-section
The relevant section is:
This form of ALTER TABLE ALTER COLUMN accepts a columnDefinition as in a CREATE TABLE command, with the following restrictions.
Restrictions
...
The NOT NULL attribute will be that of the new definition (similar to previous item).
However, the parser rejects the query with "unexpected token: NOT in statement". The same is true when adding a DEFAULT clause and other clauses.
The documentation you link to is for version 1.8 (see the top of the file).
HSQLDB version 2.x documentation shows the syntax as ALTER TABLE x ALTER COLUMN i SET DATA TYPE BIGINT or SET NOT NULL
http://hsqldb.org/doc/guide/databaseobjects-chapt.html#dbc_table_manupulation
Although there is an undocumented compatibility feature that allows you to omit the word COLUMN
Last edit: Fred Toussi 2018-04-09
I see, thanks for the clarification.
I keep forgetting about the manual version - would be great if unversioned URLs would point to the latest version, and versioned URLs only would point to specific versions, but that's a different story :)
Hmm, no your suggested syntax doesn't seem to work on version 2.4.0. It appears that only a single one of these actions can be executed in a statement:
<alter column action> ::= <set column default clause> | <drop column default clause> | <alter column data type clause> | <alter identity column specification> | <alter column nullability> | <alter column name> | <add column identity specification> | <drop column identity specification>
Last edit: Lukas Eder 2018-03-29
Yes, only one action at a time is generally allowed.