Re: [GENERAL] Tigger after delete with plpgsql

2012-08-31 Thread fellipeh
Found the error... my movimento_ad0() was set to statement .. I change to Row, and works fine now... Thanks for all -- View this message in context: http://postgresql.1045698.n5.nabble.com/Tigger-after-delete-with-plpgsql-tp5722154p5722190.html Sent from the PostgreSQL - general mailing list

Re: [GENERAL] Tigger after delete with plpgsql

2012-08-31 Thread Alan Hodgson
On Friday, August 31, 2012 12:41:42 PM fellipeh wrote: > Here is error msg: > http://postgresql.1045698.n5.nabble.com/file/n5722180/erro_PG.png > > sorry, but in portuguese.. > > > > -- > View this message in context: > http://postgresql.1045698.n5.nabble.com/Tigger-after-delete-with-plpgsql-tp

Re: [GENERAL] Tigger after delete with plpgsql

2012-08-31 Thread fellipeh
Here is error msg: http://postgresql.1045698.n5.nabble.com/file/n5722180/erro_PG.png sorry, but in portuguese.. -- View this message in context: http://postgresql.1045698.n5.nabble.com/Tigger-after-delete-with-plpgsql-tp5722154p5722180.html Sent from the PostgreSQL - general mailing list arch

Re: [GENERAL] Tigger after delete with plpgsql

2012-08-31 Thread Alan Hodgson
On Friday, August 31, 2012 12:12:32 PM fellipeh wrote: > Yes, the error appears when I delete "nfentrada_item" row > View this message in context: > http://postgresql.1045698.n5.nabble.com/Tigger-after-delete-with-plpgsql-tp > 5722154p5722173.html Sent from the PostgreSQL - general mailing list arc

Re: [GENERAL] Tigger after delete with plpgsql

2012-08-31 Thread fellipeh
Yes, the error appears when I delete "nfentrada_item" row Here is code: -- View this message in context: http://postgresql.1045698.n5.nabble.com/Tigger-after-delete-with-plpgsql-tp5722154p5722173.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql

Re: [GENERAL] Tigger after delete with plpgsql

2012-08-31 Thread Alan Hodgson
On Friday, August 31, 2012 03:14:15 PM Fellipe Henrique wrote: > CREATE TRIGGER nfentrada_item_tr1 > BEFORE DELETE > ON public.nfentrada_item FOR EACH ROW > EXECUTE PROCEDURE public.nfentrada_item_ad0(); > > here is my nfentrada_item_ad0(); > > delete > from MOVIMENTO > wher

Re: [GENERAL] Tigger after delete with plpgsql

2012-08-31 Thread Fellipe Henrique
Hi, I`m using Before Delete.. CREATE TRIGGER nfentrada_item_tr1 BEFORE DELETE ON public.nfentrada_item FOR EACH ROW EXECUTE PROCEDURE public.nfentrada_item_ad0(); here is my nfentrada_item_ad0(); delete from MOVIMENTO where (IDEMPRESA = OLD.idempresa) and (upp

Re: [GENERAL] Tigger after delete with plpgsql

2012-08-31 Thread Tulio
Hi, You're using a trigger AFTER, in your case could be BEFORE? Cause when you use AFTER the var OLD not exists... I don't know if I understand exactly what you'll do to ativate this trigger.. but I think maybe is it.. try.. Em 31/08/2012 1

Re: [GENERAL] Tigger after delete with plpgsql

2012-08-31 Thread Alan Hodgson
On Friday, August 31, 2012 02:10:47 PM Fellipe Henrique wrote: > Hello, I`m try to use this code for my After Delete trigger: > > delete > from MOVIMENTO > where (IDEMPRESA = OLD.idempresa) and > (upper(TABELA) = 'NFENTRADA_ITEM') and > (CODIGO = OLD.idempresa_item); > > But

[GENERAL] Tigger after delete with plpgsql

2012-08-31 Thread Fellipe Henrique
Hello, I`m try to use this code for my After Delete trigger: delete from MOVIMENTO where (IDEMPRESA = OLD.idempresa) and (upper(TABELA) = 'NFENTRADA_ITEM') and (CODIGO = OLD.idempresa_item); But, when execute. show me error.. that`s says "old is not initialize" (sorry,but I