Edit multiple columns

Answered

I hope i'm on the right forum.

I'm using Datagrips to browse the information in my database, and I can't find the way to edit multiple rows at once. So for example I have a Partners table and a registration_type_id column. I want to set the status of all the partners to '1' but if I select all the status cells, and type '1' then only the last one selected will change value. Is there a way to do this from the gui? 

0
16 comments
Avatar
Yuriy Vinogradov

Hello, please tell me DataGrip version you are running. Just checked  latest 2019.3.3 and this works as expected, you select multiple rows, type a value and it appears in all selected cells.

0

I have the same problem for integer rows. For text it works as before.

IntelliJ IDEA 2019.3.3 (Ultimate Edition)
Build #IU-193.6494.35, built on February 11, 2020
Runtime version: 11.0.5+10-b520.38 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 5.5.7-1-MANJARO

0
Avatar
Yuriy Vinogradov

Can you please tell us which database you are using and send a DDL for a table where you have this issue?

0

PostgresSQL 9.6/12 

Here's the sample DLL, I cannot modify the season/episode column in bulk.

-- auto-generated definition
create table files
(
id bigserial not null
constraint files_pkey
primary key,
title varchar(256) not null,
size bigint,
"season" integer,
"episode" integer,
"createdAt" timestamp with time zone not null,
"updatedAt" timestamp with time zone not null
);


create index files_season_episode
on files ("season", "episode");```
0

I checked on DataGrip 2020.01, it works for columns that have string values, but for integer columns it does not. Here's a DDL for a table I can't edit: 

```

create table clients
(
id bigint unsigned auto_increment
primary key,
name varchar(100) not null comment 'Client name',
name_kana varchar(100) not null comment 'Client kana name',
industry_type_id tinyint unsigned not null comment 'Client industry type',
last_day_to_charge tinyint unsigned null,
pay_in_month_id tinyint unsigned not null,
last_day_to_pay tinyint unsigned null,
api_link_senses varchar(255) null comment 'Api link',
number_of_employees int unsigned null comment 'Number of employees for this Client',
stock_status_id int unsigned default 1 not null comment 'Status of the stock for this Client''s company',
charge_type tinyint unsigned not null,
pay_type tinyint unsigned not null,
note varchar(1000) null comment 'Note for this client',
created_at timestamp default CURRENT_TIMESTAMP not null,
updated_at timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP,
deleted_at timestamp null
)
collate=utf8mb4_unicode_ci;

```

 

Columns like industry_type_id or last_day_to_charge, I have to edit row by row, which is quite troublesome. 

0

Hello, I have the same issue. any update?

 

0

Hello

Got same problem, but are using an workaround.

1) Change one value to "1"

2) Copy that value

3) Mark all the fields you want to change.

4) Paste the value in.

 

Saved me a lot of time!

1

I would love to see this feature, which works well for string variables, available for other field types as well.

0

Hello Christoph,
It's already possible to edit multiple numeric (and other types) cells at once. I've just checked it in DataGrip 2021.2.4
Though this feature is disabled for columns with unique indexes (including primary keys)

What IDE version do you use?

0

Hello Ludmilla,

I tried versions 2021.2.4 and 2021.3 EAP for macOS. Only the last marked value is changed.

0

and what is you database?

0

SQLite. I have performed some additional tests. It seems to be only a problem with columns of type UNSIGNED INT. It may be related to a problem I have already reported (request #3566450).

CREATE TABLE Test
(
int integer,
varchar varchar,
unsignedInt unsigned integer
);
INSERT INTO main.Test (int, varchar, unsignedInt)
VALUES (1, 'abc', 123),
(2, 'bcd', 234),
(3, 'cde', 345);

It works for column 1 (int), column 2 (varchar), but not for column 3 (unsignedInt)

0

Reproduced. Thanks!
I've already found the cause.
It will be fixed in next release - 2021.3

0

Many, many thanks! You guys are amazing!

0

I have the same problem now when I switched to PSQL15 and replaced an unique index which used coalesced to use new `NULL NOT DISTINCT` index feature. Not sure why this feature would be disabled in a table has an unique index involving multiple columns, editing just one of them doesn't necessarily break the constraint. And if anything you'd get back a PSQL error if you break the constraint anyway, so not sure why to restrict such useful feature.

0

Hi Paulius Papl,

What is your current IDE version, and could you also provide a DDL of the data objects in question?

0

Please sign in to leave a comment.