Most voted "sql-update" questions
Update is an SQL statement that changes the data of one or more records in a table, as well as a subset of results, and can also be filtered by conditions.
Learn more…270 questions
Sort by count of
-
2
votes3
answers1512
viewsHow to do so, if the record exists, it updates, if it does not do an Insert of the same
I am a beginner in the forum and in php and I have a question. I have a table with id auto_incremento and name is primary key. There is how I do IF and ELSE using UPDATE and INSERT. Where, if there…
-
2
votes1
answer367
viewsUpdate only records marked with checkbox at once php
I have a select that carries a series of records. Behold, in these records I need to apply an up and that, in my head, the best way would be using a checkbox field, so that when the user checked the…
-
2
votes1
answer706
viewsImplicit conversion of the nvarchar data type into varbinary(max) is not allowed. Use the CONVERT function to perform this query
Follows code: byte[] image1 = ConvertTo.Bytes(Request.Files[0]); byte[] image2 = null; ctx .Users .Where(x => x.Id == 1) .Update(x => new User() { ImageByte1 = image1, ImageByte2 = image2 });…
-
2
votes1
answer288
viewsLoad data into a div table within a form
I have this form: <form name="form4" method="POST" onsubmit="return form_validation()" > <h1><center><strong>Saída de…
-
2
votes1
answer7523
views(Mysql) Insert or Update in the database
I need to perform one Insert in the database, if there is no Cpf of a person. if there is it has to do a Update. But all this through a single script on Mysql. I illustrated the example below as I…
-
2
votes0
answers175
viewsUpdate within a mysql function
I have to do a process to perform an update on a given table field. I created a function in mysql. But within this function would need to perform an update, but the non-accepted function would have…
-
2
votes1
answer162
viewsChange more than one value in the same column with an UPDATE
I have the following doubt.. I have the example table - reply in the following format *------------*--------------* |resposta_id | INT | |pergunta_id | INT | |resposta | VARCHAR(45) |…
-
2
votes2
answers188
viewsHow to update only one column of the record?
I made a code to update some columns of my record when needed. There are 7 columns listed on array, but usually I will only update 1 or 2 columns. With this code I can update my record, but I have…
-
2
votes1
answer75
viewsDoes it matter to delete and create new lines or update old ones?
Not taking into account the technical difficulty of doing one thing or another, but rather the consistency of the bank, the speed of subsequent operations and the professionalism. If I have a…
-
2
votes1
answer215
viewsUpdate Database Problem "too long string literal"
I have a problem when it comes to Update of a content to the database, below the code used for the Update public function atualizar_conteudo_manual() { $dadosmanual_update = array…
-
2
votes2
answers69
viewsset Enum field to null in Procedure
I have a precedent that I receive some data and these may come empty up there all right, but when the field is Enum and I try to set as null gives data truncated error for column even the field can…
-
1
votes1
answer1120
viewsChange zip code column by inserting dash in Firebird
I have a table of cities where I own the Zip Code. The data looks like this: 89620000 I’d like to leave it at that: 89620-000 How can I do this in Firebird?
-
1
votes1
answer4011
viewsUpdate sql with 2 conditions
I have a table with the column STATURE This column consists of 3 possible values: NEW, VISUALIZED, DISCARDED I have a function where I need to implement an SQL row that updates my table and changes…
-
1
votes1
answer2560
viewsUpdate multiple Ids at the same time
How to update multiple records at the same time with just one click php/mysql? Example:…
-
1
votes2
answers13056
viewsChanging Mysql data in PHP
I have the Tb_workers where it is filled in by a form. And then I created another page to change this data. Altering.php $id = $exibe["id"]; $Nome = $exibe["Nome"]; $Morada = $exibe["Morada"]; $Tipo…
-
1
votes0
answers63
viewsupdate mysql error
I’m getting this error when I try to update with mysql in Asp. Microsoft VBScript compilation error '800a03ee' Expected ')' /postos/reg.asp, line 525 set ins_regenf1 = conn.Execute("UPDATE reg SET…
-
1
votes1
answer288
viewsRun an UPDATE on Mysql only when the number of Rows is 1
How to make a UPDATE only run when the number of Rows returned is 1 in a single query with SQL syntax only using the example below? Example: SELECT count(*) AS rows FROM exemplo WHERE id_usuario =…
-
1
votes2
answers1648
viewsMysql UPDATE multiple fields under the same condition (IF or CASE)
Friends, I need help. I have these two darlings: UPDATE leilaov SET seconds = CASE WHEN (mesini = MONTH(NOW()) AND diaini = DAYOFMONTH(NOW()) AND horaini = HOUR(NOW()) AND minutoini <=…
-
1
votes1
answer120
viewsUpdate error "Call to Undefined Function mysqli_sql()"
When performing the update is returned me the following error in the first result: Error: Fatal error: Call to Undefined Function mysqli_sql() in F: XAMPP htdocs PAPBRUNO PAPBRUNO…
-
1
votes2
answers713
viewsProblem with UPDATE mysql
I have a problem executing an UPDATE command in my Database... My table has 2 columns: -Column 1: link (PK) varchar -Column 2: varchar status I need to update only the "statuz" field of my table.…
-
1
votes2
answers174
viewsProblem with Sqlite Android Data Base
So my problem is this one, I’ve tried and researched everything but I couldn’t implement any solution. I tried to update the database with the update and also insert new columns with ALTER TABLE,…
-
1
votes0
answers99
viewsLimits for updating with Bufferedreader in mysql
Hello everybody good morning, I am having problems with a update routine in the mysql database, I am reading a Bufferedreader containing more than 3,000,000 records and updating in mysql but when I…
-
1
votes2
answers90
viewsUpdate all table records with Sqlitedatabase.update()
I have the following code to update a field in my table. I wonder if I could change the "note" and "missing" fields in all table records. Example: put all records with note = 8 and missing = 5…
-
1
votes1
answer1137
viewsUpdate in Visual Studio database
could tell me where is the error in this small piece of code that I am creating for a budget program with a database with 4 tables (only the last cmd7 object is not accepted in the compilation):…
-
1
votes2
answers10224
viewsUpdating multiple records to the same ID
Consider the following scenario for controlling license information in a database Products 1 - Solução x 2 - Solução y 3 - Solução z Suppose the Customer has the 3 solutions Licence table | ID |…
-
1
votes1
answer985
viewsupdate multiple records with php mysql checkbox
I need to update a mysql table with data coming from a/two checkbox where checked is 2 and unchecked is 1. It turns out that if you check the id6 of the col1 it will update the id4. What will be…
-
1
votes1
answer258
viewsProblems with update mysql
I have a field from a table that saves the path to a locally stored file. When I run the following command: UPDATE tabela1 set caminho = 'c:\logs\caminho.txt' where cod_tab = 1 it saves without the…
-
1
votes2
answers309
viewsSQL update query syntax error
When I run the following update query there is a syntax error before or inside from: UPDATE Artigos SET totale = entradas.sent FROM Artigos INNER JOIN (SELECT cod_artigo, Sum([quantidade_ent]) AS…
-
1
votes1
answer199
viewsUpdate table with data from another table decreasing character
Hello, I have the bank BDMCOM1 that has a table Product Balance and a column Quantity with values like: 1,000. But I have another bank BDMCOM1_V3_ALEA that also has the table Product Balance and…
-
1
votes3
answers2439
viewsPopular Modal Bootstrap for User Edit
Good morning, you guys, I have a user screen with a list that was populated by a foreach, and each line has a link to edit the user. This link opens a modal that should already come with user…
-
1
votes2
answers234
viewsTrigger that accumulates the Mysql result
Considering the following tables: Gambler( id; name number. ) j equipe_ficticia( id; user name; name; dot_fictitious; ) Ef equipe_ficticia_player( id; equipeFicticiaId; pilotoId; ) efj step( id;…
-
1
votes1
answer89
viewsHashbytes with different value when selecting and writing with update
SELECT HASHBYTES('MD5','123') This select above returns me the following result: 0x202CB962AC59075B964B07152D234B70 But when I update the table using the same hashbytes UPDATE USUARIOSLOGADOS SET…
-
1
votes1
answer51
viewsHow to update a field using it at the same time?
I wonder if there’s a way to add the value of a line to itself without having to do a query then an update. I have a column called total that stores integers, at a given time I want the value that…
-
1
votes2
answers15532
viewsHow to do an UPDATE using data from two different tables?
Once upon a time the table: Id dado1 dado2 01 1000 10 02 1234 12 03 9999 1 I had a task cron which performed the following update daily: UPDATE tabela1 SET dado1 = dado1 + dado2; Only to organize…
-
1
votes2
answers354
viewsUpdate command does not update table
I’m having trouble with my CRUD. My code searches in BD and returns me the data on the screen correctly, the problem that when I saved, it does not update the BD and also does not display any error…
-
1
votes1
answer1040
viewshow to take data from one mysql table and insert it into another :?
I’m trying to do brush validator (serial), but I don’t know how to do it. I have two tables: "validation" and "maturity". In the "validation" table, you have the following fields: id(int),…
-
1
votes0
answers96
viewsJpaupdateclause with Join
I have the following entities: @Entity @Getter @Setter @NoArgsConstructor @Table(schema = "MYDB", name = "TB_TESTE") public class Teste implements Serializable { @ManyToOne @JoinColumn(name =…
-
1
votes1
answer252
viewsCompound update
I have a table pessoas where, I have several fields referring to the person’s registration, One of these fields is the PES_NUMERO, which is nothing more than the code of the person in the system,…
-
1
votes2
answers256
viewsData field update in string format
Guys, I took an old bank from a client where there’s a birth date column that’s in a string format and doesn’t date. So far so good only that it has certain recorded dates that do not have the 0 in…
-
1
votes2
answers47
viewsWhen I do the UPDATE it saves in the database correctly, but when I update the page the data disappears from the database
I am trying to recover the data from a table inside an input where the user can be updated and save in the same table through UPDATE. I managed to do the UPDATE, but edit the data by input and send,…
-
1
votes2
answers872
viewsUpdate only in one column character - Oracle
I have a column, where this written R. TEST, I just need to make a correction leaving for STREET. TEST, how to make this change in the Oracle database.
-
1
votes1
answer70
viewsProblem with android UPDATE
I got a problem when it comes to giving update in a table on Android/SqLite: I tried both ways I found: String query = "UPDATE MY_TABLE SET VALUE1='VALUE1'... WHERE KEY_ID = KEY_ID" SQLiteDatabase…
-
1
votes1
answer1643
viewsUpdate several records at once
Hello, I have a table with the following fields:KEY, VALUE , ALIAS, CLIENT_ID. In a certain system process I need to update Key and Value. To update a record I have no problems, the problem is that…
-
1
votes1
answer202
viewsError run UPDATE SQL Server
When executing the update statement below is occurring the following error. What can be? Msg 116, Level 16, State 1, Line 3 Only an expression can be specified in the selection list when the…
-
1
votes1
answer113
viewsUpdate Postgresql
I have a question, a customer reported that there was an error in the registration of his products, and the employees registered the cost price as the price practiced and vice versa. Could I run an…
-
1
votes1
answer149
viewsTesting UPDATE in Postgres
The idea is to do a search with the BEFORE result, run UPDATE with the appropriate changes and run a new search with DEPOIS, then undo all the changes, a test for UPDATE. SELECT id_evento,…
-
1
votes1
answer1091
viewsPerforming UPDATE on ORACLE using FROM
How to do UPDATE in Oracle records without using a clause IN to change data in bulk? Thus: UPDATE TABELA1 SET DADO = DADO FROM TABELA2 WHERE TABELA1.CODIGO = TABELA2.CODIGO; Currently he me force to…
-
1
votes2
answers984
viewsHow to update data from a table only if the new values are different from the current ones?
How can I do an UPDATE only if the data sent is different from the data stored? I’m with the following: <?php header('Content-type: application/json'); header('Access-Control-Allow-Origin: *');…
-
1
votes1
answer45
viewsUpdate does not find what was typed in the inputs
I have a system where you can change the information of a record through an editing form, only this edition is not being saved. HTML <?php $lnk = mysqli_connect('localhost','root','') or…
-
1
votes1
answer310
viewsExport Text field to Bytea in Postgresql
I could make an application to export the contents of a Text field to Bytea without problems, but since there are thousands of records I believe that if I do via SQL will be faster. If that is…