Questions tagged as 'sql-update'

1
answer

Update with SET giving error

I have several UPDATE with pretty much the same code as this: UPDATE cliente SET Email = '[email protected]' WHERE idCliente = 0000; But some give this error:    Data truncation: Data too long for column 'Email' at...
asked by 10.08.2018 / 03:30
2
answers

How to update data from a table only if the new values are different from the current values?

How can I do an UPDATE only if the submitted data is different from the stored data? I have the following: <?php header('Content-type: application/json'); header('Access-Control-Allow-Origin: *'); include 'database.php'; $cod_oferta...
asked by 12.05.2017 / 00:20
2
answers

Performing update on several records for the same ID

Consider the following scenario for controlling information about licenses in a database Products 1 - Solução x 2 - Solução y 3 - Solução z Suppose you have all 3 solutions Licenses table | ID | CLIENTE_ID | PRODUTO_ID | DATA_...
asked by 27.01.2016 / 16:30
2
answers

How to do an UPDATE using data from two different tables?

The table was once: Id dado1 dado2 01 1000 10 02 1234 12 03 9999 1 I had a cron task that ran the following update daily: UPDATE tabela1 SET dado1 = dado1 + dado2; Just to organize things, move dado2...
asked by 05.11.2016 / 00:11
3
answers

Update does not work

In my system there is a registration page and a page with a table of the information of the registered ones. This table has an edit button that links to an equal form on the registration page. What should happen: When you click the save...
asked by 05.09.2017 / 15:19
1
answer

When firing an Update Trigger, one of the fields only refreshes after a second Update

I created a trigger to report the fine on the return delay of rented movies, however, when triggering the trigger once (giving an UPDATE), the "MultaTotal" field does not update (only it). But when the trigger is triggered a second time, the fie...
asked by 09.12.2018 / 16:27
3
answers

How to create an incremental Update sql command

I have a Estoque table where today there are already many rows of records already registered, how can I do an incremental update to populate a column that added the table now? Produto | N_Serie | Etiqueta A | 123 | NULL...
asked by 27.07.2017 / 15:16
1
answer

Laravel 5.4 - Update in related tables

What is the best way to do a update on two tables at the same time? I thought it was just calling the related table, but when I do this it just does the update in the service table and not the client table. I was able to do this by pa...
asked by 05.10.2017 / 16:17
1
answer

how to get data from one mysql table and insert into another:?

I'm trying to make pincode validator (serial), but I do not know how to do it. I have two tables: "validation" and "expiration". In the "validation" table, it has the following fields: id(int), data(varchar), pincode(varchar), status(int...
asked by 20.11.2016 / 00:10
1
answer

How do I update a field using it at the same time?

I would like to know if you have a way to sum the value of a line with itself without having to query after an update. I have a column called total that holds integers, at some point I want the value that is on this line to be s...
asked by 21.09.2016 / 05:05