Re: Returning NULL results?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Returning NULL results?
Дата
Msg-id 434BCE99.1040608@archonet.com
обсуждение исходный текст
Ответ на Returning NULL results?  (Mario Splivalo <mario.splivalo@mobart.hr>)
Ответы Re: Returning NULL results?  (Mario Splivalo <mario.splivalo@mobart.hr>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ichar
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: ichar