Hi folks,
I’m trying to do an insert using the DB Merge node, but all the columns in my table are primary keys. It doesn’t seem to want to let me set it up without adding at least one column in the SET section, but all my columns need to be in the WHERE.
Are there any ways to allow this? Any suggested workarounds?
Thanks!
Isn’t it the other way round. The values you want to have should be the set while the question which rows to change are the where.
If you really just want to insert data there is this node:
In general: having all columns as primary keys sounds like an uncommon structure. Maybe you want consider the implications of that.
3 Likes
Thanks @mlauber71, it probably is the other way around.
I recognize that having a table with all primary keys is uncommon, but in this case it is part of a standardized data model, where the table in question stores the keys in a name-value pairs structure. It underlies a commercial software, and isn’t something I can change.
Ultimately, I’ve ended up just joining to the destination table first and filtering out any exiting records, and then using the DB Insert. Although it would be nice if you could run the merge node against a table consisting of all keys.
1 Like