Re: Nulls get converted to 0 problem

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Nulls get converted to 0 problem
Дата
Msg-id 20030605053426.GG3268@dcc.uchile.cl
обсуждение исходный текст
Ответ на Nulls get converted to 0 problem  (Avi Schwartz <avi@CFFtechnologies.com>)
Ответы Re: Nulls get converted to 0 problem  ("scott.marlowe" <scott.marlowe@ihs.com>)
Список pgsql-general
On Wed, Jun 04, 2003 at 10:26:22AM -0500, Avi Schwartz wrote:

> select * from item_catalog where item_category is null
>
> With SQl Server 7, this works as expected, but with PostgreSQL, the
> value Coldfusion is setting the integer variables to is 0 (zero) and
> not "" as it should.

You probably can do

select coalesce(column1::text, ''), coalesce(column2::text, ''), ...
from item_catalog where item_category is null;

(Note that everything is going to come back as TEXT rather than numbers,
though)

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Las cosas son buenas o malas segun las hace nuestra opinion" (Lisias)

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

Предыдущее
От: "Coby Beck"
Дата:
Сообщение: implicit type conversions
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Anonymous CVS access