Re: how to proccess record returning null

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: how to proccess record returning null
Дата
Msg-id 5053A806.4060700@hogranch.com
обсуждение исходный текст
Ответ на Re: how to proccess record returning null  (te <tejal_1910@yahoo.co.in>)
Ответы Re: how to proccess record returning null  (te <tejal_1910@yahoo.co.in>)
Список pgsql-bugs
On 09/14/12 8:31 AM, te wrote:
> Sorry I didnt mention it.
>
> temp is a table name.
>
> FOR r in select distinct(id) from temp
>
> There are no distinct id's in table 'temp', so record 'r' has null values.
>
> So I guess the control is not going inside the loop.
>
> Any suggestions?

there's a difference between zero records, and a record containing null
fields..


yes, if there are no records, the loop will execute zero iterations, and
result will be integer zero.

as coded, for each record, it will test if id is null or an empty
string,   the result value will be that of the last distinct(id);

since no id is likely to be null or an empty string, the odds are, it
will be returning 999 if there are any records and 0 if there aren't any.


what exactly do you WANT to do?



--
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast

В списке pgsql-bugs по дате отправления:

Предыдущее
От: te
Дата:
Сообщение: Re: how to proccess record returning null
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: BUG #7534: walreceiver takes long time to detect n/w breakdown