Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 1E2679FBA5E; Thu, 12 Apr 2007 19:44:27 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 81943-10; Thu, 12 Apr 2007 19:44:17 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from bay0-omc3-s37.bay0.hotmail.com (bay0-omc3-s37.bay0.hotmail.com [65.54.246.237]) by postgresql.org (Postfix) with ESMTP id 815B59FB831; Thu, 12 Apr 2007 19:44:21 -0300 (ADT) Received: from BAY131-W19 ([65.55.136.54]) by bay0-omc3-s37.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Thu, 12 Apr 2007 15:44:20 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_9d395dbb-805d-4433-a2c6-c6efdea7edac_" X-Originating-IP: [67.116.31.14] From: Karthikeyan Sundaram To: , Subject: question on plpgsql block Date: Thu, 12 Apr 2007 15:44:19 -0700 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 12 Apr 2007 22:44:20.0010 (UTC) FILETIME=[1BC700A0:01C77D54] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.711 tagged_above=0 required=5 tests=AWL=-0.954, BAYES_20=-0.74, DNS_FROM_RFC_ABUSE=0.2, DNS_FROM_RFC_POST=1.708, HTML_40_50=0.496, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200704/124 X-Sequence-Number: 25188 --_9d395dbb-805d-4433-a2c6-c6efdea7edac_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Gurus, =20 I tried a plpgsql block from the php. =20 example=20 =20 a=3D'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 =3D where condition; commit; end;'; =20 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 i= t says "ERROR: current transaction is aborted, commands ignored until end = of transaction block"=20 =20 Why? =20 Did we need to do any special step up to execute a block or blocks won't= execue from command line mode? Please advise. =20 Regards skarthi =20 =20 =20 _________________________________________________________________ Your friends are close to you.=A0Keep them that way. http://spaces.live.com/signup.aspx= --_9d395dbb-805d-4433-a2c6-c6efdea7edac_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Gurus,
 
    I tried a plpgsql block from the php.
 
    example
 
    a=3D'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 =3D <new value> where co= ndition;
    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 u= tility.  Then it says "ERROR:  current transaction is aborted, co= mmands ignored until end of transaction block"
 
  Why?
 
   Did we need to do any special step up to execute a block or bl= ocks won't execue from command line mode? Please advise.
 
Regards
skarthi
 
 
 


Your friends are close to you.=A0 Keep them that way. = --_9d395dbb-805d-4433-a2c6-c6efdea7edac_--