Re: Returning a bool on DELETE in a proc. - Mailing list pgsql-sql

From Richard Huxton
Subject Re: Returning a bool on DELETE in a proc.
Date
Msg-id 41EE4FB2.9080307@archonet.com
Whole thread Raw
In response to Re: Returning a bool on DELETE in a proc.  (KÖPFERL Robert <robert.koepferl@sonorys.at>)
Responses Re: Returning a bool on DELETE in a proc.  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
List pgsql-sql
KÖPFERL Robert wrote:
> Thanks, but that was not what I was looking for.
> 
> Seems that I forgot to mention that this function is intended to be written
> in SQL, not in PL/SQL. For the second one I already picked it off the
> fascinating* doc (as Keith did) that GET DIAGONSTIC is the right thing.
> 
> So what variable/function is the correct SQL-equivalent to ROW_COUNT and can
> it be used in the following statement ?
> like DELETE...; SELECT (ROW_COUNT<>0); to return a bool value?

SQL doesn't support that (although I suppose it could be made to with 
some pg_rows_affected() function). You'll need to use plpgsql (or 
similar) if you want a result status returned.

--  Richard Huxton  Archonet Ltd


pgsql-sql by date:

Previous
From: Achilleus Mantzios
Date:
Subject: Re: mail + rfc822, rfc2822 + schema
Next
From: RobertD.Stewart@ky.gov
Date:
Subject: Re: Looking for examples of S/P