Return num of deleted rows from function

Started by Ben-Nes Michaelover 23 years ago2 messagesgeneral
Jump to latest
#1Ben-Nes Michael
miki@canaan.co.il

Hi All

How can I RETURN from within a function the number of deleted rows ?

like select into var delete from bla bla .... <- can work, or something
similar ?

Thanks in Advance

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ben-Nes Michael (#1)
Re: Return num of deleted rows from function

"Ben-Nes Michael" <miki@canaan.co.il> writes:

How can I RETURN from within a function the number of deleted rows ?

In plpgsql, use GET DIAGNOSTICS - see bottom of
http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/plpgsql-statements.html

regards, tom lane