Apache derby Double 数据类型 - 并尝试将其默认为“null”
嗯,我在这里有点困惑,但这似乎是一个非常愚蠢的问题。
我正在尝试创建一个具有默认为空的双列的表。我得到的是一个双列的表,默认情况下为 0,我不知道为什么。
代码的相关部分:
CREATE_TABLE_STATEMENT = "create table " + TABLE_NAME + "
(id int not null generated always as identity constraint pk primary key,
parentid int default null, title varchar(50), minimum double default null,
maximum double default null, timeUnit double default null,
comment varchar(150) default null)";
以及相应的“插入”:
"insert into " + TABLE_NAME + " " + "(parentid, title) values (1, 'first')"
Well, I'm a bit puzzeled here, yet it seems to be a really dumb question.
I'm trying to create a table that has a double column that is null by default. What i get is a table with a double column that is 0 by default, and I have no idea why.
The relevant part of the code:
CREATE_TABLE_STATEMENT = "create table " + TABLE_NAME + "
(id int not null generated always as identity constraint pk primary key,
parentid int default null, title varchar(50), minimum double default null,
maximum double default null, timeUnit double default null,
comment varchar(150) default null)";
And the corresponding "insert":
"insert into " + TABLE_NAME + " " + "(parentid, title) values (1, 'first')"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎在我的 Derby 副本上运行良好(见下文)。
是什么让您认为默认 null 无法正常工作?
Seems to work fine on my copy of Derby (see below).
What makes you think the default of null isn't working properly?