From: Richard Huxton <dev@archonet.com>
To: mario.splivalo@mobart.hr
Cc: pgsql-sql@postgresql.org
Subject: Re: Returning NULL results?
Date: Tue, 11 Oct 2005 15:39:21 +0100
Message-ID: <434BCE99.1040608@archonet.com> (raw)
In-Reply-To: <1129040845.7911.9.camel@ekim>
References: <1129040845.7911.9.camel@ekim>
Mario Splivalo wrote:
>
> Of course, if it returns no rows, I'm presented with an error, saying:
>
> ERROR: record "rec" has no field "_qv"
>
> This is logical. My question would be is there a way around this
> withouth first doing SELECT COUNT(*) FROM tmbBids WHERE ..., and then if
> COUNT(*) is zero THEN bidCount := NULL ELSE if COUNT(*) is not zero then
> do SELECT from the begining?
Could you check the FOUND variable? As in IF NOT FOUND THEN RETURN NULL
--
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, mario.splivalo@mobart.hr
Subject: Re: Returning NULL results?
In-Reply-To: <434BCE99.1040608@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