Re: Returning NULL results? - Mailing list pgsql-sql

From Richard Huxton
Subject Re: Returning NULL results?
Date
Msg-id 434BCE99.1040608@archonet.com
Whole thread Raw
In response to Returning NULL results?  (Mario Splivalo <mario.splivalo@mobart.hr>)
Responses Re: Returning NULL results?
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: ichar
Next
From: Richard Huxton
Date:
Subject: Re: ichar