X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 51734D1B4E5; Sat, 20 Sep 2003 07:26:04 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 84535-06; Sat, 20 Sep 2003 04:25:33 -0300 (ADT) Received: from postfix4-1.free.fr (postfix4-1.free.fr [213.228.0.62]) by svr1.postgresql.org (Postfix) with ESMTP id 435F8D1B53F; Sat, 20 Sep 2003 04:25:31 -0300 (ADT) Received: from free.fr (lns-p19-9-62-147-243-253.adsl.proxad.net [62.147.243.253]) by postfix4-1.free.fr (Postfix) with ESMTP id 56D6B4C6C4; Sat, 20 Sep 2003 09:25:10 +0200 (CEST) Message-ID: <3F6C01D4.7090000@free.fr> Date: Sat, 20 Sep 2003 09:29:24 +0200 From: Jean-Michel Chabanne User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.3.1) Gecko/20030428 X-Accept-Language: fr, en-us, en MIME-Version: 1.0 To: shyamperi@davlin.co.in Cc: pgsql-admin@postgresql.org, pgsql-sql@postgresql.org Subject: Re: Error with functions References: <2753631.1064039518784.JavaMail.tomcat@mail.davlin.co.in> In-Reply-To: <2753631.1064039518784.JavaMail.tomcat@mail.davlin.co.in> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/327 X-Sequence-Number: 10415 shyamperi@davlin.co.in 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: plpgsql: ERROR during compile of sample near line 2 >ERROR: parse error at or near ";" > >Can any body tell me why is this error coming >----- >Warm Regards >Shÿam Peri > >II Floor, Punja Building, >M.G.Road, >Ballalbagh, >Mangalore-575003 >Ph : 91-824-2451001/5 >Fax : 91-824-2451050 > > >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. > > > ------------------------------------------------------------------------ > > 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 compile of sample near line 2 > ERROR: parse error at or near ";" > > Can any body tell me why is this error coming > >----- >Warm Regards >Shÿam Peri > >II Floor, Punja Building, >M.G.Road, >Ballalbagh, >Mangalore-575003 >Ph : 91-824-2451001/5 >Fax : 91-824-2451050 > > > > > > > * 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.* > >------------------------------------------------------------------------ > > >---------------------------(end of broadcast)--------------------------- >TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > > Hi, I juste did a copy/paste of your sample on my test DB. I didn't get any error message and the function works fine. I run PostgreSQL 7.3.3 -- Jean-Michel Chabanne 77450 MONTRY (FRANCE) 48" 54' N - 2" 49' E Powered by Linux