Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 94D9E9FA59C for ; Fri, 13 Apr 2007 03:28:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 59734-10 for ; Fri, 13 Apr 2007 03:28:40 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.179]) by postgresql.org (Postfix) with ESMTP id DF8E99FB548 for ; Fri, 13 Apr 2007 03:28:41 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu0) with ESMTP (Nemesis), id 0MKwh2-1HcFGy0zeB-0005i3; Fri, 13 Apr 2007 08:28:40 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1HcFGx-00070c-00 for pgsql-sql@postgresql.org; Fri, 13 Apr 2007 08:28:39 +0200 Date: Fri, 13 Apr 2007 08:28:39 +0200 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: question on plpgsql block Message-ID: <20070413062839.GB24558@a-kretschmer.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! User-Agent: Mutt/1.5.9i X-Provags-ID: V01U2FsdGVkX1+t/SWz4yAKuQfObYiCmG32QgpItLZN6El9/Wa 6dSxD7Y9cMQBwycoFqJ/EX+4pClHBormt5dJj7Rh9TlSU4lauk Vh8oJq0PJpZNP4c1IhIamA6uUasmHmH X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/138 X-Sequence-Number: 28138 am Thu, dem 12.04.2007, um 15:44:19 -0700 mailte Karthikeyan Sundaram folgendes: > Hi Gurus, > > I tried a plpgsql block from the php. > > example > > a='begin > insert into table a values (....); > insert into table b values (....) > insert into table c values (...) > select into p_var ... from table where condtion > update a set column = where condition; > commit; > end;'; > > I works fine when I call this block from php, whereas, I tried to copy the > same value from the command line prompt or PGadmin GUI utility. Then it says > "ERROR: current transaction is aborted, commands ignored until end of > transaction block" > > Why? My guess: PHP treat each line separately and sends line by line to the server and adds the missing ';' if necessary. If you send this from the GUI the server received one big command with syntax-errors, because the missing ';' after some commands. Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net