1
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, id_statusevento FROM syo_evento WHERE id_evento = 771678;
UPDATE syo_evento SET id_statusevento = 'CANCELADO' WHERE id_evento = 771678;
SELECT id_evento, id_statusevento FROM syo_evento WHERE id_evento = 771678;
ROLLBACK
It works, but in Datastudio 4.7 I only get the result of the first SELECT, while in pgAdmin 3 I don’t get "Query result with 1 Row discarded." there is some way to do what I need ?
Missed using the
begin
before youupdate
to initiate a transaction.– Clodoaldo Neto