Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id DF7929552D4 for ; Tue, 28 Feb 2012 08:23:15 -0400 (AST) Received: from mail47.e.nsc.no ([193.213.115.47]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S2M5I-000332-Fl for pgsql-sql@postgresql.org; Tue, 28 Feb 2012 12:23:15 +0000 Received: from balapapa.localnet (81.61.9.46.customer.cdi.no [46.9.61.81]) (authenticated bits=0) by mail47.nsc.no (8.14.4/8.14.4) with ESMTP id q1SCMuOt026786 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 28 Feb 2012 13:22:57 +0100 (MET) From: Leif Biberg Kristensen To: pgsql-sql@postgresql.org Subject: Re: How to convert SQL store procedure to Postgresql function Date: Tue, 28 Feb 2012 13:22:56 +0100 User-Agent: KMail/1.13.7 (Linux/3.2.1-gentoo-r2; KDE/4.7.4; x86_64; ; ) References: <1330419004.47440.YahooMailNeo@web121602.mail.ne1.yahoo.com> <1330430206.16326.YahooMailNeo@web121606.mail.ne1.yahoo.com> In-Reply-To: <1330430206.16326.YahooMailNeo@web121606.mail.ne1.yahoo.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201202281322.56490.leif@solumslekt.org> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201202/94 X-Sequence-Number: 36387 Tirsdag 28. februar 2012 12.56.46 skrev Rehan Saleem : > hi , > whats wrong with this function , i am getting syntax error which is syntax > error at or near "+=" LINE 13: set sql += ' bpoverlap, centredistance You can't concatenate that way in plpgsql. Instead of "set sql +=" try with just "||" which is the operator joining two strings. regards, Leif http://code.google.com/p/yggdrasil-genealogy/