default value not null not working as expected
Joseph Tam <[email protected]> Fri, 25 May 2018 10:14:20 -0400
| Newsgroups | gmane.comp.java.hsqldb.user |
|---|---|
| Message-ID | <CAPhqasC2kGAm6kLmQ4=PdBvRzuPJa5B9+2wwhRM6DmQSOvR6JQ@mail.gmail.com> |
Hi..
I am having trouble with the default value (setting current_timestamp)
in hsql 2.4.1
when I take off the not null from the column, I can see that it is not
populating the column with the default value, so the exception is
valid.
when does the default value get used? thanks in advance!
details:
create table users
(
id bigint generated by default as identity(start with 1),
username varchar(255),
start_date timestamp default current_timestamp not null,
end_date timestamp
);
insert into users (username, start_date, end_date) values ('jtam', null, null);
integrity constraint violation: NOT NULL check constraint;
SYS_CT_11667 table: USERS column: START_DATE
-joe
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot