[SQL] problem with function trigger

2004-01-18 Thread jclaudio
Hi I'm trying to update a table column with a pl/pgsql function and a trigger. But I didn't managed to make it work so far. Here's my  function code : CREATE FUNCTION public.calcul_impact() RETURNS opaque AS ' DECLARE id_line integer; quantity integer; single_price real; total_cost real; am

Re: [SQL] problem with function trigger

2004-01-16 Thread Christoph Haller
> > Hi I'm trying to update a table column with a pl/pgsql function and a > trigger. > But I didn't managed to make it work so far. > > Here's my function code : > > CREATE FUNCTION public.calcul_impact() RETURNS opaque AS ' > > DECLARE > id_line integer; > quantity integer; > single_price

[SQL] problem with function trigger

2004-01-13 Thread jclaudio
Hi I'm trying to update a table column with a pl/pgsql function and a trigger. But I didn't managed to make it work so far. Here's my  function code : CREATE FUNCTION public.calcul_impact() RETURNS opaque AS ' DECLARE id_line integer; quantity integer; single_price real; total_cost real; a

Re: [SQL] Problem with function & trigger

2001-07-09 Thread Carlo Vitolo
Tom Lane wrote: > Carlo Vitolo <[EMAIL PROTECTED]> writes: > > This does not work. The error is ERROR: pg_atoi: error in "12.00": can't > > parse ".00" > > What PG version are you running? It seems to work fine for me in > current sources: > > Ver. 7.1.2 > > BTW, the way you are writing the fu

Re: [SQL] Problem with function & trigger

2001-07-07 Thread Tom Lane
Carlo Vitolo <[EMAIL PROTECTED]> writes: > This does not work. The error is ERROR: pg_atoi: error in "12.00": can't > parse ".00" What PG version are you running? It seems to work fine for me in current sources: regression=# create table magazzino (quantita numeric(10,2), regression(# descrizio

[SQL] Problem with function & trigger

2001-07-07 Thread Carlo Vitolo
This does not work. The error is ERROR: pg_atoi: error in "12.00": can't parse ".00" CREATE FUNCTION "togliscar" () RETURNS opaque AS 'BEGIN UPDATE magazzino SET quantita = (SELECT quantita FROM magazzino WHERE descrizione = NEW.descrizione ) - NEW.quantita WHERE descrizione = NEW.descrizione; RE