Bulk delete in table

Hi! I saw a few posts discussing bulk delete from selecting multiple rows in a table, but when I trigger the query, I get this error message:

select count() as "count" from "devis_items" where "id" = $1 - invalid input syntax for type integer: "{"5714","5676","5772"}"*

The array of ID's is well formatted, and as integers [5714, 5676, 5772] so I'm not sure why I'm getting that message. any ideas? thanks

I don't think this is an integer array because there are double quotes inside the array. It means that these are string-type numbers. Also, make sure that your query is set to delete multiple records.

Ok, nevermind. I realised that the GUI layout wasn't doing it. The direct SQL query was the way, with the ids joined like "...WHERE id IN ({{ arrayOfIds.join(",") }})". Thanks

or where id = ANY({{arrayofIds}}) if it's PostgreSQL :slight_smile:

actually using the pgAdmin query tool, "WHERE id IN()" worked too!

1 Like