pgplsql and parameters question

From: Alex Sandini <asandini(at)keyware(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: pgplsql and parameters question
Date: 2002-09-11 12:57:10
Message-ID: 3D7F3DA6.9050207@keyware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I don't get parameters working in my pgplsql functions.
I.e.:

CREATE FUNCTION add_one (INTEGER) RETURNS INTEGER AS '
BEGIN
RETURN ($1 + 1);
END;
' LANGUAGE 'plpgsql';

Does not work's for me, while the following one works just fine.

CREATE FUNCTION startweek() RETURNS DATE AS '
DECLARE
start date;
BEGIN
start:= to_date(''01-01-''||date_part(''year'', timestamp ''now''),''DD
MM YYYY'') + date_part(''week'', timestamp ''now'') * 7 - 8;
RETURN start;
END;
' LANGUAGE 'plpgsql';

Any idea?
Thanks,

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Manfred Koizar 2002-09-11 13:12:30 Mailing lists archive search
Previous Message dima 2002-09-11 11:13:21 Re: transactions