Why isn't that null

From: Matthias Teege <matthias(at)mteege(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Why isn't that null
Date: 2000-06-27 06:52:37
Message-ID: 200006270652.IAA23069@moon.mteege.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Moin,

I have al small problem with ISNULL in a trigger
function. My definition looks like:

IF NEW.vkp ISNULL THEN
select t1.las into i_kd
from auftrag t1, aufpos t2 where
t2.auftrag = t1.id;
select get_vkp(i_kd, NEW.artikel) into f_vkp;
NEW.vkp:=f_vkp;
END IF;

The following SQL query didnt cause this if statement:

insert into aufpos(auftrag, artikel, best_menge, vkp,
lieferwoche, cuser, ctime, uuser, utime) values
('175','8501900','12','','3500','matthias',
now (), 'matthias',now ())

If I change the function statement as follows:

IF NEW.vkp = 0 THEN
...
END IF;

it works but '0' is a leagal value but not '' (empty). The
function should only be called if NEW.vkp ist empty.

Many thanks
Matthias

Responses

Browse pgsql-general by date

  From Date Subject
Next Message jprem 2000-06-27 07:09:14 connection time out
Previous Message stanislas pinte 2000-06-27 06:29:00 connection time-outs