All Questions
Tagged with insert-update upsert
43
questions
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 ...
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,...
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": &...
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 ...
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 ...
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 ...
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": [
...
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 ...
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,
...
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(...
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 ...
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 ...
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 ...
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 ...
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 ...