Re: [GENERAL] Getting number of affected row after performing update

2010-02-19 Thread Alban Hertroys
On 19 Feb 2010, at 6:42, Yan Cheng Cheok wrote: >-- HOW?!?! >--ERROR: column "rowcount" does not exist >--LINE 1: SELECT @@ROWCOUNT=0 >IF @@ROWCOUNT=0 THEN > EXECUTE 'INSERT INTO statistic(fk_lot_id, "value", measurement_type, > statistic_type) VALUES ($1, $2, $3, $4)' >

Re: [GENERAL] Getting number of affected row after performing update

2010-02-19 Thread Richard Huxton
On 19/02/10 05:42, Yan Cheng Cheok wrote: Of course, I get an error at line : IF @@ROWCOUNT=0 THEN May I know what is the correct PostgreSQL syntax for @@ROWCOUNT after update? Best place for this sort of information is the manuals: http://www.postgresql.org/docs/8.4/static/plpgsql-statement