Re: [ADMIN] error with functions

2003-09-22 Thread Stephan Szabo
On Mon, 22 Sep 2003 [EMAIL PROTECTED] wrote: > >You do realize that the shell is going to interpret that string in > >double quotes right? > I guess so, for the very same I have tried with > Command: psql test -c "> CREATE FUNCTION add_one (integer) RETURNS > INTEGER AS ' BEGIN RETUR

Re: [ADMIN] error with functions

2003-09-22 Thread Oliver Elphick
On Mon, 2003-09-22 at 06:42, [EMAIL PROTECTED] wrote: > >You do realize that the shell is going to interpret that string in > >double quotes right? > I guess so, for the very same I have tried with > Command: psql test -c "> CREATE FUNCTION add_one (integer) RETURNS > INTEGER AS ' BEGIN

Re: [ADMIN] error with functions

2003-09-21 Thread shyamperi
>You do realize that the shell is going to interpret that string in >double quotes right? I guess so, for the very same I have tried with Command: psql test -c "> CREATE FUNCTION add_one (integer) RETURNS INTEGER AS ' BEGIN RETURN ''$1'' + 1; END; ' LANGUAGE 'plpgsql';" But still

Re: [ADMIN] error with functions

2003-09-21 Thread Stephan Szabo
On Mon, 22 Sep 2003 [EMAIL PROTECTED] wrote: > Command: psql test -c "> CREATE FUNCTION add_one (integer) RETURNS > INTEGER AS ' BEGIN REURN $1 + 1; END; ' LANGUAGE > 'plpgsql';" You do realize that the shell is going to interpret that string in double quotes right? ---

Re: [ADMIN] error with functions

2003-09-21 Thread shyamperi
Command: psql test -c "> CREATE FUNCTION add_one (integer) RETURNS INTEGER AS ' BEGIN REURN $1 + 1; END; ' LANGUAGE 'plpgsql';" Result: CREATE FUNCTION And the function executed perfectly fine. - Warm Regards Shÿam Peri II Floor, Punja Building, M.G.Road, Ballalbagh, Mangalor

Re: [ADMIN] error with functions

2003-09-21 Thread Stephan Szabo
On Mon, 22 Sep 2003 [EMAIL PROTECTED] wrote: > Dear all, > This is about the same problem which I have been facing for the past one week and > which I am unable to solve. > I have create a function which return +1 of the argument passed. > Function Definition: > CREATE FUNCTION add_one (integer)

Re: [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

Re: [ADMIN] 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: [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