Re: [SQL] [ADMIN] Error with functions

2003-09-20 Thread Jean-Michel Chabanne
[EMAIL PROTECTED] a écrit : Hey, create or replace function sample(varchar,int) returns varchar as' declare data alias for $1; size alias for $2; begin return substr(data,(length(data)-size)+1,length(data)); end; ' language 'plpgsql'; WARNING: pl

Re: [SQL] [ADMIN] Error with functions

2003-09-20 Thread Tom Lane
[EMAIL PROTECTED] writes: > CREATE FUNCTION add_one (integer) RETURNS INTEGER AS ' > BEGIN > RETURN $1 + 1; > END; > ' LANGUAGE 'plpgsql'; > The expected ouput of the above function should be 11 when we pass the 10 t= > o it but it returns 1. Works fine for me: regression=# CR