Skip site navigation (1) Skip section navigation (2)

question on plpgsql block

From: Karthikeyan Sundaram <skarthi98(at)hotmail(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>, <pgsql-sql(at)postgresql(dot)org>
Subject: question on plpgsql block
Date: 2007-04-12 22:44:19
Message-ID: BAY131-W19843640CD2CBC297E50AAB05E0@phx.gbl (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-sql
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 = <new value> 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?
 
   Did we need to do any special step up to execute a block or blocks won't execue from command line mode? Please advise.
 
Regards
skarthi
 
 
 
_________________________________________________________________
Your friends are close to you. Keep them that way.
http://spaces.live.com/signup.aspx

Responses

pgsql-admin by date

Next:From: Peter EisentrautDate: 2007-04-12 23:38:47
Subject: Re: question on plpgsql block
Previous:From: Peter EisentrautDate: 2007-04-12 15:35:15
Subject: Re: Where are aliases stored?

pgsql-sql by date

Next:From: Peter EisentrautDate: 2007-04-12 23:38:47
Subject: Re: question on plpgsql block
Previous:From: PostgreSQL AdminDate: 2007-04-12 19:51:07
Subject: Re: Replace string

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group