达梦数据库,对自增主键赋值插入,报错仅当指定列列表,且SET IDENTITY_INSERT为ON时,才能对自增列赋值;
INSERT INTO cloud.account (id, uuid, account_name, type, role_id, domain_id, account."default") VALUES (1, '0efa51a7-b227-4dff-8c9d-4af994915fff', 'system', '1', '1', '1', 1);
一、开启IDENTITY_INSERT
SET IDENTITY_INSERT cloud.account ON; INSERT INTO cloud.account (id, uuid, account_name, type, role_id, domain_id, account."default") VALUES (1, '0efa51a7-b227-4dff-8c9d-4af994915fff', 'system', '1', '1', '1', 1);
二、不要插入主键
INSERT INTO cloud.account (uuid, account_name, type, role_id, domain_id, account."default") VALUES ('0efa51a7-b227-4dff-8c9d-4af994915fff', 'system', '1', '1', '1', 1);