From: Richard Huxton <dev@archonet.com>
To: KÖPFERL Robert <robert.koepferl@sonorys.at>
Cc: pgsql-sql@postgresql.org
Subject: Re: Returning a bool on DELETE in a proc.
Date: Wed, 19 Jan 2005 12:16:50 +0000
Message-ID: <41EE4FB2.9080307@archonet.com> (raw)
In-Reply-To: <ED4E30DD9C43D5118DFB00508BBBA76EB1656B@neptun.sonorys.at>
References: <ED4E30DD9C43D5118DFB00508BBBA76EB1656B@neptun.sonorys.at>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dev@archonet.com, robert.koepferl@sonorys.at
Subject: Re: Returning a bool on DELETE in a proc.
In-Reply-To: <41EE4FB2.9080307@archonet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox