Hi, This is not a bug. The term DEFAULT isn't a pseudo-column or an expression that can be used in a formula. DEFAULT is used _instead_ of an expression. I tried MySQL and it works in the same way as H2.
drop table foo cascade; CREATE TABLE FOO(c1 int null,c2 int default 1 not null); INSERT INTO FOO SET c1 = 1, c2 = default; -- works INSERT INTO FOO SET c1 = 1, c2 = default * 2; -- doesn't work What you probably want is use a parameterized statement (right?) where NULL is converted to default. H2 does support this, but it's not fully documented. You can use: drop table foo cascade; CREATE TABLE FOO(c1 int null,c2 int default 1 not null null_to_default); INSERT INTO FOO SET c1 = 1, c2 = null; Regards, Thomas -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
