Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
197 views

I have a Supabase table named "users" that contains a unique key column (text) named "id_rc1" and another column named "version" (text), among other fields all of which ...
0 votes
1 answer
34 views

I have a base table A and a result table B in DolphinDB. Table B was initially empty and is used to store calculated results based on table A. When trying to insert the calculated results into table B,...
2 votes
1 answer
297 views

Postgres has a great RETURNING clause for INSERT, DELETE and UPDATE...and it's made me a bit greedy. In a few cases, what I'd like to get is not only the current value, but the previous value: UPDATE ...
2 votes
1 answer
113 views

I am using MongoDB with C# (MongoDB.Driver) and I want to update only the fields provided in my API model. My current approach works for updating values, but I cannot set a field (string, number, or ...
0 votes
0 answers
88 views

If a value already exists in a table, how do I update the current record and add the new record as a new row? This is the current upsert query: UPDATE d SET d.[AccountId] = S.[Account_Number], ...
12 votes
2 answers
10k views

Does Snowflake support updating/inserting all columns with a syntax like UPDATE * or INSERT * MERGE INTO events USING updates ON events.eventId = updates.eventId WHEN MATCHED THEN ...
8 votes
4 answers
7k views

I've read this article on JPA concurrency, but either I am too thick or it is not explicit enough. I am looking to do a database-controlled atomic update-if-found-else-insert operation (an UPSERT). ...
3 votes
2 answers
11k views

I have a statement that looks like this: Insert into table (value1, value2, value3) Values (%s, %s, %s) Could I do something where it will attempt to insert, but on conflict update value2 and value3 ...
0 votes
2 answers
9k views

I am trying to implement upsert functionality to avoid redundant data into the database. Mentioned below is the schema that I have created. @Entity({ name: 'tokens' }) export class Token { @...
0 votes
0 answers
107 views

I am currently running into an issue with using Athena's iceberg "merge" where it ends up scanning the entire source + target table. For example, I have a source table and a target table. ...
11 votes
3 answers
7k views

bulk_create with ignore_conflicts=True insert new records only and doesn't update existing one. bulk_update updates only existing records and doesn't insert new one. Now I see only one variant to ...
383 votes
11 answers
245k views

I have the following UPSERT in PostgreSQL 9.5: INSERT INTO chats ("user", "contact", "name") VALUES ($1, $2, $3), ($2, $1, NULL) ON CONFLICT("user", "contact") DO ...
179 votes
14 answers
211k views

I have two separately unique columns in a table: col1, col2. Both have a unique index (col1 is unique and so is col2). I need INSERT ... ON CONFLICT ... DO UPDATE syntax, and update other columns in ...
0 votes
0 answers
58 views

I am trying to create a DLT pipeline and this is my first time doing it. What is the best possible way to satisfy my following requirements. I am fully aware that the path I am choosing may not be ...
0 votes
0 answers
80 views

Code Snippet : def write_alert_summary_df_docdb(alert_df,database,collection): try: update_df = DynamicFrame.fromDF(alert_df.select("*",lit("update").alias(&...
5 votes
1 answer
8k views

I'm trying to upsert using SQLAlchemy. There's no upsert in SQL but SQLAlchemy provides this. The same thing I'm trying to perform with SQLAlchemy ORM session. My code: from sqlalchemy.orm import ...
0 votes
2 answers
103 views

I'm encountering a challenge with my Prisma objects and could use some insights. I've defined the following Prisma objects, and my expectation is to optionally pass an id and perform an upsert. ...
2 votes
1 answer
144 views

I have a table with account_number, amount , last_updated_time. I wrote a merge query as below MERGE INTO account AS target USING (SELECT ?,?,?) AS SRC(account_number, amount , last_updated_time) ON ...
1 vote
0 answers
718 views

I have tried multiple ways to incremental load (upsert) into the Postgres database (RDS) using Spark (with Glue Job) but did not find satisfactory performance. I have tried like this: 1. Delete the ...
1 vote
1 answer
562 views

I have a pipeline with copy data task where I upsert some data from On-Prem SQL into Synapse. The setup is such that I first establish the list of tables and then, in ForEach, I dynamically set Key ...
2 votes
1 answer
5k views

I have a statement configured that looks something like this (paraphrasing here, don't have the actual code in front of me): <insert id="createRecord" parameterType="map"> INSERT INTO MYTABLE ...
2 votes
1 answer
166 views

I have a simple scenario, where I want to atomically read and modify the state of a row. But the row may not exist yet. For this example, I use the user_group_membership table: user_id (pk) | group_id ...
0 votes
2 answers
272 views

I want to insert or update rows into my models table. But can't figure out the query. SmStudentAttendance This is my model. $students is my collection. I have put the collection fields in arrays. ...
0 votes
2 answers
104 views

I'm trying to add a timestamp column, updated_at, in the updates when doing a upsert using on_conflict_do_update. Below is my current implementation but encounter the below error when running at the ...
7 votes
2 answers
756 views

I have a table storing directory paths (Dirs). These directory rows are referenced by a Files table, using the directory's rowid as a foreign key. When re-indexing directories/files there is the need ...

1
2 3 4 5
26