Re: Why is this function wrong

From: "shakahshakah(at)gmail(dot)com" <shakahshakah(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Why is this function wrong
Date: 2005-10-24 17:00:57
Message-ID: 1130173257.448144.55500@g44g2000cwa.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

slight modification to the previous post, sorry, see
http://www.postgresql.org/docs/8.0/interactive/plpgsql-structure.html
for the real docs.

CREATE OR REPLACE FUNCTION "public"."cproc_hli" (bgtemp NUMERIC,
humidity NUMERIC, wspeed NUMERIC) RETURNS NUMERIC AS $$
BEGIN
IF ($1 < 25) THEN
SELECT (10.66 * (0.28 * $2)+(1.3 * $1) - $3) ;
ELSE
SELECT (8.62 * (0.38 * $2) + (1.55 * $1) - (0.5 * $3) + (exp(- $3 +
2.4))) ;
END IF ;
END ;
$$ LANGUAGE 'plpgsql' VOLATILE RETURNS NULL ON NULL INPUT SECURITY
INVOKER;

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas F. O'Connell 2005-10-24 17:08:56 Re: Why is this function wrong
Previous Message shakahshakah@gmail.com 2005-10-24 16:51:45 Re: Why is this function wrong