[Please don't post in HTML.]
On Mon, Jun 20, 2005 at 12:27:41AM +0000, Prasad dev wrote:
> I have been trying to figure out why this simple query doesn't
> execute if no record exist !
> CREATE OR REPLACE FUNCTION del_rest() RETURNS TRIGGER AS '
> t record;
> SELECT * INTO t FROM del2 WHERE (d2=OLD.d2 or old.d2 is null)
> and (d3=OLD.d3 or old.d2 is null);
In the last line above, should the last part of the expression be
"old.d3 is null" instead of "old.d2 is null"? Perhaps that's why
the subsequent IF NOT FOUND isn't doing what you expect, if that's
indeed the problem you mean.
If the expression is correct as shown, then please post a minimal
but complete example that somebody could load into an empty database
to reproduce the problem. That is, all SQL statements to create
the necessary tables, functions, and triggers, and to populate the
tables with a sample data set; also the query that's not behaving
the way you expect and an explanation of what you'd like it to do.
In response to
pgsql-novice by date
|Next:||From: ed||Date: 2005-06-20 03:39:39|
|Subject: help with function .. .. date data type|
|Previous:||From: John DeSoi||Date: 2005-06-20 01:28:44|
|Subject: Re: help with function .. .. date data type|