开发者

Inserting a new row into a single column table in apache derby with generated id

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);
inser开发者_StackOverflow中文版t into indices default values;

however that didn't work with derby.


Try "insert into indices values (default)"


You need a column to insert into. You have id which is an identity, which means it will already have a value when a new row is inserted. Add a new column and then fill that column in your insert statement.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜