Thread: Return num of deleted rows from function

Return num of deleted rows from function

From
"Ben-Nes Michael"
Date:
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



Re: Return num of deleted rows from function

From
Tom Lane
Date:
"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