Re: Passing a null value in pl/pgsql - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Passing a null value in pl/pgsql
Date
Msg-id 20020114145706.M27397-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Passing a null value in pl/pgsql  (Mike Finn <mike.finn@tacticalExecutive.com>)
List 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 by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: 7.2 changes to varchar truncation
Next
From: Tom Lane
Date:
Subject: Re: Passing a null value in pl/pgsql