Re: Nulls get converted to 0 problem

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Avi Schwartz <avi(at)CFFtechnologies(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Nulls get converted to 0 problem
Date: 2003-06-04 18:48:25
Message-ID: Pine.LNX.4.33.0306041244230.16142-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

FYI, "" does NOT equal NULL does not equal 0.

If an application wishes to store a null value, it should store a null
value, not a blank value.

Since blanks are not allowed in integers, the only legal value for CF to
store is either NULL or 0.

If you attempt to store '' or "" into an integer column, you should get an
error.

CF's lack of support for nulls is their issue, and one of the dozens of
reasons I switched development from that to PHP in my shop.

I would guess this might be a known and fixed bug in cold fusion. Have
you checked for updates on their site yet?

A database application language that doesn't understand NULLs is broken,
and needs to be fixed.

On Wed, 4 Jun 2003, Avi Schwartz wrote:

> Hi,
>
> I have this very strange problem that I cannot figure out.
>
> I am in the process of converting a Coldfusion MX application from SQL
> Server to PostgreSQL 7.3.2 running on SuSE Linux 8.2.
> Since Coldfusion has no support for real null, when a select returns a
> null value, the value of the Coldfusion variable is set to "", even if
> it a numeric value like int.
>
> For example, the following query should display nothing in the
> item_category column:
>
> 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. This of course is a big problem. I checked with
> other people using the combination of PostgreSQL and Coldfusion and
> they cannot reproduce it. This makes me think that there may be a
> problem with my database as created.
>
> Now the interesting thing is that if I use another tool to examine the
> results, they do display null in this column.
>
> At this point I pretty much lost. Any idea what may the problem be?
>
> Thanks,
> Avi
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jan Wieck 2003-06-04 19:25:35 Re: SAP and MySQL ...
Previous Message Andrew Sullivan 2003-06-04 18:41:52 Re: Nulls get converted to 0 problem