Skip to content

Insert Primary Key after import CSV Data does not work #3321

@Dirzei

Description

@Dirzei

Hi,
I want to add a new column to a database (import from csv file using csvread).

With H2 Version 1.4.200 the following was working:
ALTER TABLE TEST_TABLE ADD COLUMN ID BIGINT NOT NULL AUTO_INCREMENT FIRST

I tried this with the latest version 2.0.204. But it is not working.
The error message I get is:
NULL not allowed fo column "ID"; SWL statement:
INSERT INTO "PUBLIC"."TEST_TABLE_COPY_3_0" SELECT NULL, "ROW_NUM", "COLUMN_NUM", "ROW_VALUES" FROM "PUBLIC"."TEST_TABLE" [23502-204]

I did also try:
ALTER TABLE TEST_TABLE ADD COLUMN ID BIGINT GENERATED BY DEFAULT AS IDENTITY FIRST

But it is also not working...

Is this a bug, or do I something wrong here?

Thank you - cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions