Re: [ADMIN] Trigger with dynamic SQL

2010-05-25 Thread Josi Perez (3T Systems)
Alex Hunsaker, thank you for your suggestion, but, the processor do not replace OLD.TG_ARGV[1] by the content. If I use OLD in EXECUTE it is not recognized. I didn't get how to pass an integer variable to the trigger. I already create repeteadly times the trigger changing the UPDATE comand inside

Re: [ADMIN] Trigger with dynamic SQL

2010-05-24 Thread Josi Perez (3T Systems)
Thank you. The trigger: CREATE OR REPLACE FUNCTION logdata() RETURNS trigger AS $BODY$DECLARE arg_table varchar; arg_id varchar; arg_oldinteger; qrytext; BEGIN arg_table := TG_ARGV[0]; arg_id:= TG_ARGV[1];--field to use OLD.id arg_old := TG_ARGV[2]; --va

Re: [ADMIN] Trigger with dynamic SQL

2010-05-24 Thread Alex Hunsaker
On Wed, May 19, 2010 at 06:30, Josi Perez (3T Systems) wrote: > To avoid to delete registers I created one trigger activated "before delete" > with lines like that: > UPDATE tableX  set dtExc = 'now', userExc = current_user where idTableX = > OLD.idTableX; > return NULL; > > but, I need do the sam

Re: [ADMIN] Trigger with dynamic SQL

2010-05-24 Thread Szymon Guz
2010/5/24 Josi Perez (3T Systems) > Sorry for the inconvenience, but no one have ideas to solve this problem? > Am I in the wrong list to ask this? > Need I create triggers for each table? > > Thanks in advance for any suggestions. > Josi Perez > > 2010/5/19 Josi Perez (3T Systems) > > To avoid

Re: [ADMIN] Trigger with dynamic SQL

2010-05-24 Thread Josi Perez (3T Systems)
Sorry for the inconvenience, but no one have ideas to solve this problem? Am I in the wrong list to ask this? Need I create triggers for each table? Thanks in advance for any suggestions. Josi Perez 2010/5/19 Josi Perez (3T Systems) > To avoid to delete registers I created one trigger activated

[ADMIN] Trigger with dynamic SQL

2010-05-19 Thread Josi Perez (3T Systems)
To avoid to delete registers I created one trigger activated "before delete" with lines like that: UPDATE tableX set dtExc = 'now', userExc = current_user where idTableX = OLD.idTableX; return NULL; but, I need do the same for many tables and I don't catch how. I created an sql variable to constr