Re: [SQL] Error with functions

2003-09-20 Thread shyamperi
5:08p Dear All, When I am executing any function with parameter.. I am unable to access them. So, I would be thankful if, anyone can help me in teaching this aspect. CREATE FUNCTION add_one (integer) RETURNS INTEGER AS ' BEGIN RETURN $1 + 1; END; ' LANGUAGE 'plpgsql'; The expected

Re: [SQL] Error with functions

2003-09-20 Thread shyamperi
Hey, PostgreSQL 7.3 on i686-pc-linux-gnu, compiled by GCC 2.96 But, I am getting error when I am using the alias key word. And also when I try to create a C function for the same and excute I am getting the following error ERROR: Memory exhausted in AllocSetAlloc(677865842) And, I am allocating

Re: [SQL] Error with functions

2003-09-20 Thread Tomasz Myrta
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: plpgsql: ERROR during compil

[SQL] Error with functions

2003-09-19 Thread shyamperi
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: plpgsql: ERROR during compil