Please tell is it possible to save any data fo file when I execute update statement ?
I execute this function in postgres pgadmin / psql
do
$$
declare
nr int;
status varchar(100);
begin
select count(*) into nr from film where title = 'Academy Dinosaur';
if nr = 1 then
update film
set length = 1000
where title = 'Academy Dinosaur';
status := 'Success';
end if;
end;$$
and I want to write to file (if update was executed succesfully ) something like this: Title = title, Status = Succes (if successful) but I don't know how to do this and how to return value of status to file ? I don't want to copy of all table.
select count(*)is executed.