Re: [SQL] functions and triggers

2002-08-20 Thread Stephan Szabo
On Tue, 20 Aug 2002, Martin Marques wrote: > Quoting Stephan Szabo <[EMAIL PROTECTED]>: > > > > > > The problemas are two: > > > > > > 1) when I try to create the trigger, it says that the function doesn't > > exist. > > > Why is this happening? > > > > You should probably show us what you were t

Re: [SQL] functions and triggers

2002-08-20 Thread Martin Marques
Quoting Stephan Szabo <[EMAIL PROTECTED]>: > > > The problemas are two: > > > > 1) when I try to create the trigger, it says that the function doesn't > exist. > > Why is this happening? > > You should probably show us what you were trying to do, but I'm going to > guess that the function doesn

Re: [SQL] functions and triggers

2002-08-20 Thread Stephan Szabo
On Tue, 20 Aug 2002, Martin Marques wrote: > I'm trying to build a trigger that will update a timestamp field in a table with > the current timestamp, and I just can't make it work. > > The problemas are two: > > 1) when I try to create the trigger, it says that the function doesn't exist. > Why

Re: [SQL] Functions and Triggers

2001-03-27 Thread Jan Wieck
Cedar Cox wrote: > > CREATE FUNCTION lastupdated() RETURNS opaque AS ' > begin > new.last_updated := CURRENT_TIMESTAMP; > return new; > end; > ' LANGUAGE 'plpgsql'; > > CREATE TRIGGER trigname BEFORE INSERT OR UPDATE on tblname > FOR EACH ROW EXECUTE PROCEDURE lastupdated(); > > Note: you co

Re: [SQL] Functions and Triggers

2001-03-26 Thread Cedar Cox
CREATE FUNCTION lastupdated() RETURNS opaque AS ' begin new.last_updated := CURRENT_TIMESTAMP; return new; end; ' LANGUAGE 'plpgsql'; CREATE TRIGGER trigname BEFORE INSERT OR UPDATE on tblname FOR EACH ROW EXECUTE PROCEDURE lastupdated(); Note: you could use now() instead of CURRENT_TIMES

Re: [SQL] Functions and Triggers

2001-03-26 Thread Richard Huxton
From: "Norbert Schollum" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 26, 2001 10:24 AM Subject: [SQL] Functions and Triggers > Hello there! > > here is what i want to realize: > > a trigger, that puts a now() in the last_updated field, on any update of > that table. > > i rea