使用生成的 id 将新行插入到 apache derby 中的单列表中
我有下表:
create table indices (
id int primary key generated by default as identity
);
如何插入新行?
我已经尝试过一些我发现的事情,例如:
insert into indices values (null);
insert into indices default values;
但这对德比战不起作用。
I have the following table:
create table indices (
id int primary key generated by default as identity
);
how do I insert a new row?
I have already tried several things I have found, like:
insert into indices values (null);
insert into indices default values;
however that didn't work with derby.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试“插入索引值(默认)”
Try "insert into indices values (default)"
您需要一个
列
来插入
。您有id
,它是一个identity
,这意味着插入新行时它已经有一个值。添加新的列
,然后在insert
语句中填充该列
。You need a
column
toinsert
into. You haveid
which is anidentity
, which means it will already have a value when a new row is inserted. Add a newcolumn
and then fill thatcolumn
in yourinsert
statement.