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

[SQL] functions and triggers

2002-08-20 Thread Martin Marques
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 is this happening? 2) How does the trigger tell the func

[SQL] Functions and Triggers

2001-06-20 Thread Hunter, Ray
Title: Functions and Triggers Is there anyone that can point me into the right direction for creating a function and trigger that will do something along these lines: I have a table that has router card types and a status on them: TEST_RECORD    CARD                STATUS 1

[SQL] Functions and Triggers

2001-06-20 Thread Hunter, Ray
Title: Functions and Triggers Is there anyone that can point me into the right direction for creating a function and trigger that will do something along these lines: I have a table that has router card types and a status on them: TEST_RECORD    CARD                STATUS 1

[SQL] Functions and Triggers

2001-06-06 Thread Hunter, Ray
Title: Functions and Triggers I need help on creating a sql function that will check four rows in a table based on that check it will update another row on a different table.  I want to use this function in a trigger statement. Table 1 (Test Type) id cat sub-cat test        stat

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,

[SQL] Functions and Triggers

2001-03-26 Thread Norbert Schollum
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 read the manual but i wasnt able to make a working function. what is the return value here? is there any or is it void? has somebody a example for me that is simi

Re: [SQL] sql functions and triggers

2001-03-07 Thread Karel Zak
On Wed, Mar 07, 2001 at 03:03:59PM +0100, Andrzej Roszkowski wrote: > Hello! > > It is possible to pass ie. insert fields and values to sql function in > trigger? I want to define a trigger on insert (select delete etc.) and log > some values in different table(s). Sure, see docs about SPI in

[SQL] sql functions and triggers

2001-03-07 Thread Andrzej Roszkowski
Hello! It is possible to pass ie. insert fields and values to sql function in trigger? I want to define a trigger on insert (select delete etc.) and log some values in different table(s). -- "Code reviews are like sex, just anyone can do it, but skill and training can make you a lot better a