Re: error with functions

From: shyamperi(at)davlin(dot)co(dot)in
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: error with functions
Date: 2003-09-22 04:48:53
Message-ID: 3793959.1064206578358.JavaMail.tomcat@mail.davlin.co.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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,
Mangalore-575003
Ph : 91-824-2451001/5
Fax : 91-824-2451050

----------------Original Message------------------

On Mon, 22 Sep 2003 shyamperi(at)davlin(dot)co(dot)in 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) RETURNS INTEGER AS '
> BEGIN
> RETURN $1 + 1;
> END;
> ' LANGUAGE 'plpgsql';
>
> The output it was giving was always 1, despite any argument ( not
string's ofcourse)
> When I viewed the function definition in the pg_proc table...
>
> psql "select proname,prosrc from pg_proc where proname='add_one'"
> proname | prosrc
> ---------+-------------------------------------------------------
> add_one | BEGIN RETURN +1 END;
> (1 row)
> ______________
> Can any body tell me why is the $1 missing..
> I am using running postgres 7.3.4 in linux envt
> Have a grate day

How are you creating the function?

DISCLAIMER: This message contains privileged and confidential information and is
intended only for the individual named.If you are not the intended
recipient you should not disseminate,distribute,store,print, copy or
deliver this message.Please notify the sender immediately by e-mail if
you have received this e-mail by mistake and delete this e-mail from
your system.

Attachment Content-Type Size
Untitled1 text/html 2.0 KB

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Stephan Szabo 2003-09-22 05:01:51 Re: error with functions
Previous Message shyamperi 2003-09-22 04:22:27 error with functions