开发者

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

开发者 https://www.devze.com 2023-02-10 04:19 出处:网络
I have the following table: create table indices ( id int primary key generated by default as identity );

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

精彩评论

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

关注公众号