thanks, this is the first function I wrote for postgresql, I removed the declare section, now my code is:
-----------------------
CREATE FUNCTION progression_job(IN data1 date, OUT date_for date, INOUT repetition integer)
RETURNS record AS'
BEGIN
IF repetition=0 THEN
date_for:= d + integer `1`;
ELSIF repetition=1 THEN
date_for:=d::timestamp + `3 days`::interval;
END IF;
IF repetition < 4 THEN
repetition:=repetition +1;
END IF;
return date_for;
end;'
LANGUAGE 'sql';
-------------------------
but now i got this message of error:
-----------------------
ERROR: syntax error at or near "IF"
LINE 6: IF repetition=0 THEN
^
********** Error **********
ERROR: syntax error at or near "IF"
SQL state: 42601
Character: 124
-------------------------
what is it wrong whit the IF statement?