Re: select * from mytable where myfield=null;

Поиск
Список
Период
Сортировка
От Hoanui Morangie
Тема Re: select * from mytable where myfield=null;
Дата
Msg-id 20020514123022.75739BF88@xmxpita.excite.com
обсуждение исходный текст
Ответ на select * from mytable where myfield=null;  (blamouret <bruno.lamouret@westcast-systems.com>)
Ответы Re: select * from mytable where myfield=null;  (Noel Yap <yap_noel@yahoo.com>)
Список pgsql-jdbc
I need NULL value, some of these columns are foreign keys. And using dummy values is not good practice anyway.

Hoanui



--- On Tue 05/14, Marin Dimitrov  wrote:
>
>
>
>
>
>
>
>
>  style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px;
> BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
>   ----- Original Message -----
>      style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color:
> black">From:
>   Hoanui
> Morangie
>
>
>   Hi, I understand that this behavior is a standard but agree
> with
>   Bruno that it's nonsense. I have trouble with it in my own application.
> I use
>   sql command like "select * from A where A.a=? and A.b=? and A.c=? and
> A.d=?
>   and A.e=?". There are five parameters in my query and each of them can
> be
>   null! I can not create SQL command string for all possible combinations
> of
>   null values so I have to build the query dynamically. Why then use
> prepared
>   statement? I doubt that anybody ever needed x=null in SQL
> command but
>   it seems that my example is very common. There SHOULD be some workaround
> for
>   that. But I agree that this is not topic for this list.
>
>
>
> don't use NULLs - introduce a dummy value
> that bears the
> semantic of NULL so u can use "= XXX" instead of " is
> NULL"
>
> hth,
>
>     Marin
>
> ----"...what you
> brought
> from your past, is of no use in your present. When you must choose a
> new
> path, do not bring old experiences with you. Those who strike out
> afresh,
> but who attempt to retain a little of the old life, end up torn apart
> by
> their own memories. "
>
>

------------------------------------------------
Join Excite! - http://www.excite.com
The most personalized portal on the Web!

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

Предыдущее
От: "Hoanui Morangie"
Дата:
Сообщение: Re: select * from mytable where myfield=null;
Следующее
От: Noel Yap
Дата:
Сообщение: Re: select * from mytable where myfield=null;