I struggled with the same issue for a while, and want to give my notes for this topic. I also tried format ALTER TABLE "table-name" MODIFY "column-name" NULL, which resulted in "Unknown data type: 'NOT'". It seems that h2 is expecting a column type in the MODIFY statement, although the column type is already modified from before, during CREATE TABLE. The following modification fixed the issue:
ALTER TABLE "table-name" MODIFY "column-name" varchar(128) NULL; On Tuesday, August 29, 2017 at 4:34:25 PM UTC+3 Sam Blume wrote: > Uff, I must restate my last entry: ALTER TABLE "table-name" MODIFY > "columne-name" NULL causes an odd modification. > It changes the colume type to NULL(0) (never heard of that type) > > To reporduce, do this: > > CREATE TABLE FOO ( > A VARCHAR2(50) NOT NULL, > B VARCHAR2(50) NOT NULL > ); > > show columns from FOO; > -- You will see: > FIELD > <http://159.103.98.191:8082/query.do?jsessionid=2388ee30a976dea49f8821b055c3b1b6#> > TYPE > <http://159.103.98.191:8082/query.do?jsessionid=2388ee30a976dea49f8821b055c3b1b6#> > NULL > <http://159.103.98.191:8082/query.do?jsessionid=2388ee30a976dea49f8821b055c3b1b6#> > KEY > <http://159.103.98.191:8082/query.do?jsessionid=2388ee30a976dea49f8821b055c3b1b6#> > DEFAULT > <http://159.103.98.191:8082/query.do?jsessionid=2388ee30a976dea49f8821b055c3b1b6#> > A VARCHAR(50) NO *null* NULL > B VARCHAR(50) NO *null* NULL > > -- Now use the Alter table with NULL > ALTER TABLE FOO MODIFY A NULL; > > show columns from FOO; > -- Columne 'A' is now of TYPE NULL(0) > FIELD > <http://159.103.98.191:8082/query.do?jsessionid=2388ee30a976dea49f8821b055c3b1b6#> > TYPE > <http://159.103.98.191:8082/query.do?jsessionid=2388ee30a976dea49f8821b055c3b1b6#> > NULL > <http://159.103.98.191:8082/query.do?jsessionid=2388ee30a976dea49f8821b055c3b1b6#> > KEY > <http://159.103.98.191:8082/query.do?jsessionid=2388ee30a976dea49f8821b055c3b1b6#> > DEFAULT > <http://159.103.98.191:8082/query.do?jsessionid=2388ee30a976dea49f8821b055c3b1b6#> > A NULL(0) NO *null* NULL > B VARCHAR(50) NO *null* NULL > > > > Am Dienstag, 29. August 2017 14:21:23 UTC+2 schrieb Sam Blume: >> >> Version: h2-1.4.196 >> >> ALTER TABLE "table-name" MODIFY "columne-name" NOT NULL; fails with >> Unknown data type: "NOT"; >> >> >> -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/h2-database/22ed6d69-6c3e-47a7-831c-82a793e94e7fn%40googlegroups.com.
