I have created a trigger and the function executed by the trigger.
However the function merely updates values in a table and doesn't return
any result/value. what is the correct way of "returning" nothing?
I have written this but using "return new" seems pointless as I don't
need(?) to return anything.
create or replace function update_invoice_price() returns opaque as '
begin
update invoices set total_price=(select sum(price) from invoice_li
where invoice_id=new.invoice_id) where id=new.invoice_id;
return new;
end;
' language 'plpgsql' with (iscachable);
create trigger update_invoice_li_price after update
on invoice_li for each row
execute procedure update_invoice_price();
Thanks!
Jc