Questions tagged [sql-update]
An SQL UPDATE statement is used to change existing rows in a table.
sql-update
12,148
questions
-3
votes
0
answers
22
views
Updating value in one table based on whether values (in a different column) match those in a separate table (using INNER JOIN?) [closed]
Table mailinglist has column for email addresses address and column bounced which defaults to 0. My email script will email all addresses with a 0 and ignore those with a 1 in the bounced column.
...
0
votes
0
answers
13
views
Trying to update table using PreparadStatement, But parameters are generated inside a Parentheses
Using JDBC connection in Java framework, Am updating column values my lfvadd table.
this is my sample code :
PreparedStatement pst = null;
String sql = ("UPDATE lfvadd SET recipe_name = ? WHERE ...
1
vote
1
answer
25
views
Mysql update not work, Update lochave SET LCNT = 11 WHERE LSC = 'E' and (LOCN1 >= 142 and LOCN2 <= 142);
I need to update lcnt depending on vars for locn1 to locn2
This below does not work
MariaDB [booksgood]> Update lochave SET LCNT = 11 WHERE LSC = 'E' and (LOCN1 >= 142 and LOCN2 <= 142);
...
-2
votes
1
answer
52
views
Disallow column update based on existing value
I have the sample table below
Student
Current_Checkpoint
John Smith
1
Jane Smith
3
To prevent erroneous updates or fat-finger en-masse updates, I want to enforce the following rule
For the column ...
-1
votes
0
answers
45
views
SQL Server query UPDATE different behavior in SSIS vs SSMS [closed]
I have a function to return SHA2_256.
CREATE FUNCTION [dbo].[Checksum_SHA_256]
(@Input NVARCHAR(100))
RETURNS BINARY(32)
AS
BEGIN
RETURN HASHBYTES('SHA2_256', @Input)
END
I have an UPDATE ...
0
votes
0
answers
13
views
Random long writes (waiting for handler commit) [migrated]
I have some INSERT/UPDATE queries who takes a long time randomly.
I try to launch the same INSERT several times with profiling enable.
And I remark that the duration is always in waiting for handler ...
-2
votes
0
answers
33
views
Why update not working here . Is thery any problem with the code? [duplicate]
When I run this page, it says You couldn't execute the query. I think there is a syntax problem, but I cannot see the problem.
The variables look fine when I echo them. I added the column names as a ...
0
votes
1
answer
46
views
SQL Updating a table column from first 9 digits of another column
I have a USER table with SSN in one column and SSN +5 digits (lets just call SSNPLUS) in another column. The source for SSN has become corrupted for some rows, so I would like to update the SSN from ...
0
votes
2
answers
52
views
wrong query when updating a column
I'm trying to make the following update in oracle in order to update the DT_expiration field based on the results of the subquery for the same CD_PER_ALT_IDENTIFIER, but i keep getting the same error ...
0
votes
0
answers
40
views
Dataframe to SQLAlchemy Update Statement Improvement
I created a method that updates a table called Trades from the content of a dataframe. Therefore I pass the index_cols (required for the where statement) and the update_cols (required for the set ...
0
votes
1
answer
42
views
MYSQL BEFORE DELETE Trigger history table update with revision
I've got a simple component database with some tables that contain from dozens up to hundred or so part rows with bunch of columns as parameters. I've implemented a simple history table logging to ...
0
votes
1
answer
89
views
How to limit INNER JOIN to single Row for Update
I am attempting to optimize some very ugly queries. I have this query here that is grabbing the abbreviation for a state since we are only working with abbreviations.
UPDATE [data_log]
SET [...
-1
votes
1
answer
51
views
How would I update multiple rows in a new foreign key column in an existing table, all with different values?
I have created a database with multiple tables. One table is for products and another is for instructions which go with each product. In the tables, I want to be able to link the two. I've created ...
0
votes
0
answers
27
views
ETC update query does not return modified object spring data jpa
I have a spring data jpa method that update a table based on a condition and return an object in case the update is happened or empty if the update is not happening. The database is postgres
the ...
0
votes
1
answer
74
views
UPDATE query gets stuck sometimes
I use SQL query to affect 120000 rows. Sometimes it works correctly (3-5 seconds), but often it gests stuck.
DB: Postgres. Tried on docker image of Postgres 16, on server DB. Tried with query console,...