Skip to main content

All Questions

Tagged with
1 vote
2 answers
333 views

Column reference in "On Conflict" is ambiguous

I created the following table: CREATE TABLE IF NOT EXISTS public.publications ( publication_id bigint NOT NULL DEFAULT nextval('eap_publications_publication_id_seq'::regclass), title character ...
Rune's user avatar
  • 77
1 vote
1 answer
425 views

Upsert records in postgresql

I am working with postgresql database and I have below update query which works fine - 'UPDATE "main"."item_vendor"\n' + ' SET\n' + ' "vendor_id" = $1,...
rosed's user avatar
  • 157
0 votes
0 answers
803 views

How to do an UPSERT in Python for MSSQL [duplicate]

I have the following problem. I am getting some data from an api in form of a json. I want to load this json data into an existing table. I get the data in following format: { "abcd": &...
fnavw's user avatar
  • 1
2 votes
2 answers
660 views

Concatenate string instead of just replacing it

I have a table with standard columns where I want to perform regular INSERTs. But one of the columns is of type varchar with special semantics. It's a string that's supposed to behave as a set of ...
étale-cohomology's user avatar
0 votes
1 answer
1k views

Postgres upsert with composite unique key to allow only single null value

As a part of ETL, table continuous_trips has continuous flow of incoming records. New records are aggregated and get inserted into temp. table called trips_agg every 5 minutes. CREATE TABLE IF NOT ...
sap's user avatar
  • 331
2 votes
1 answer
1k views

Error while doing UPSERT in Sqlite 3.34 - Error: near "DO": syntax error [duplicate]

I am trying to load a daily CSV load file into a main table, so that all new records are inserted and all existing records are updated. I am using UPSERT feature of Sqlite for this purpose. Here is my ...
Samridhi Dubey's user avatar
0 votes
1 answer
957 views

Problems with "updateMany" and "$pull" on array properties

I have the following object in my mongodb: { "item": { "id": "/Ed/6wigZ9LTLs2mPDWDzOFD/he0vbUEvQBl2Bga/T8=", "status": { "likes": [ ...
user826955's user avatar
  • 3,174
1 vote
1 answer
34 views

PostgreSQL Upsert For Almost Similar Values

I am trying to keep count the hits of similar values (val1,val2) within a specified threshold (± some value). For exact matches I would use UPSERT, but I can't figure out how to make it work with ...
user13687428's user avatar
2 votes
3 answers
3k views

How can I accessed upsertedId when using updateOne in MongoDB

I have new data that I want to insert in my array of blog (My collection look like this - shown below):- { _id: 0, // other vars here..., blog: [ { _id: 0, ...
lala's user avatar
  • 1,409
0 votes
1 answer
676 views

How to insert a record if not existing and update if existing (upsert) using node js mysql?

This is my insert query and now I want it to modify it using UPSERT method to check whether the reocord is existing then update if not existing insert.Here is my insert part. jsonObj = JSON.parse(...
Kirindage Gayashan's user avatar
1 vote
1 answer
821 views

Update or Insert Multiple Rows into a Table in DB2

I have a table with 3 columns (ID, NAME, DESCRIPTION). 'ID' is the PRIMARY key. As the following query in MySQL to insert/update two rows, I want to write a query for DB2 database table. INSERT INTO ...
Anuradha Karunarathna's user avatar
0 votes
2 answers
50 views

Dynamic Insert/update based on where clause in postgresql

I have two tables as shown below ob_period person_id ob_start_date 1 2007/02/11 2 2008/05/13 3 2008/07/29 4 2006/03/21 visit person_id ...
The Great's user avatar
  • 7,511
2 votes
1 answer
14k views

Correct usage of the SQLite ON CONFLICT clause

I have a SQLite database which, amongst other things, has the following table. CREATE TABLE IF NOT EXISTS biases ( data INTEGER NOT NULL, link INTEGER DEFAULT 0, bias_type INTEGER, ignores ...
DroidOS's user avatar
  • 8,780
0 votes
1 answer
92 views

Cassandra Insert/Update without duplication when you can't rely on the primary key or uuid

Here's the problem. Our 'customers' are ingested regularly as part of bulk file upload (CSV) from clients. The data we have from them is Name, Address, PostCode, Client Reference Number. We're ...
ChrisAddams's user avatar
1 vote
1 answer
11k views

Which is the best way to use a Upsert method on Azure Data Factory?

I have some csv files stored in a Blob Storage. Each csv gets updated every day. That update consist in the insertion of some new rows and the modification of some old rows. I'm using Azure Data ...
PowerBI-Morgoth's user avatar

15 30 50 per page