Re: [SQL] calling user defined function with parameters..

2001-06-16 Thread Stephan Szabo
What version are you using and what error are you getting? Your example works for me on 7.2devel once i made a dpts table with an id_dpt column. The function code is not checked for plpgsql until its first use, so if there was a syntax error, it wouldn't be seen until you tried to use it. On S

[SQL] calling user defined function with parameters..

2001-06-16 Thread Postgresql
Hi, I've created a function like this : CREATE FUNCTION tester(INT4) RETURNS BOOL AS ' DECLARE r RECORD; p ALIAS FOR $1; BEGIN SELECT INTO r id_dpt FROM dpts WHERE id_dpt=p; IF NOT FOUND THEN RETURN FALSE; ELSE RETURN TRUE; END IF; END; ' LANGUAGE 'plpgsql'; All is ok at cr