pgplsql and parameters question - Mailing list pgsql-general

From Alex Sandini
Subject pgplsql and parameters question
Date
Msg-id 3D7F3DA6.9050207@keyware.com
Whole thread Raw
List 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,


pgsql-general by date:

Previous
From: "Bradley W. Langhorst"
Date:
Subject: sql remote (from sql anywhere) functionality
Next
From: Michael und Katrin Rudolph
Date:
Subject: Table with 90 columns