From: Karsten Hilbert <Karsten.Hilbert@gmx.net>
To: pgsql-sql@postgresql.org
Subject: Re: Returning a bool on DELETE in a proc.
Date: Wed, 19 Jan 2005 14:18:47 +0100
Message-ID: <20050119141847.J732@hermes.hilbert.loc> (raw)
In-Reply-To: <41EE4FB2.9080307@archonet.com>
References: <ED4E30DD9C43D5118DFB00508BBBA76EB1656B@neptun.sonorys.at>
<41EE4FB2.9080307@archonet.com>
> >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).
If someone could only post that pg_rows_affected() function -
this would end all further requests for "row number in result
set" inquiries with the simple advice "use pg_rows_affected()
and join that with an integer table".
I'd know a bunch of uses right off the top of my head.
I suppose it ain't hard at all but my C skills are way to
limited to try anything like that. My understanding, too,
likely.
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
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: Karsten.Hilbert@gmx.net
Subject: Re: Returning a bool on DELETE in a proc.
In-Reply-To: <20050119141847.J732@hermes.hilbert.loc>
* 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