Re: Passing a null value in pl/pgsql

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Passing a null value in pl/pgsql
Дата
Msg-id 20020114145706.M27397-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Passing a null value in pl/pgsql  (Mike Finn <mike.finn@tacticalExecutive.com>)
Список pgsql-general
On Mon, 14 Jan 2002, Mike Finn wrote:

> I have two stored procedures and one calls the other.  If
> the caller passes a null for one of the parameters (the fourth) a delete
> query in the called function will not work.
>
> If I pass a null as the 4th parameter (_seqSalesOrderLine) the delete
> query below will not match any records, and my business rule fails.  If I
> temporarily (for testing only) change the asterisked line to read
>    and seqSalesOrderLine = null
> the query works as I would expect.

The only reason the above works is probably due to the hack that treats
the explicit = NULL token sequence as IS NULL which is the correct way to
compare for nulls.  SQL basically wants = between a NULL value and
anything to be unknown.


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

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: 7.2 changes to varchar truncation
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Passing a null value in pl/pgsql