Problem with trigger...
От | joepie.platteau@kulak.ac.be |
---|---|
Тема | Problem with trigger... |
Дата | |
Msg-id | 3DFE1927.6040804@kulak.ac.be обсуждение исходный текст |
Список | pgsql-general |
Hi,
I have the following problem :
I have 2 tables : T-Alumni and T-AlumniB (exact copy of Alumni, except 3 extra columns : user, date, time)
On events 'update' and 'delete' in table Alumni, I want to copy the old row to AlumniB (as a backuptable) and add the username, date and time.
So I created a function :
CREATE FUNCTION trigfunc_add_alumni() RETURNS opaque AS '
begin
insert into T-Alumni-B values (old.Id_Person, old.Member, old.Payed, old.Nr, old.Alumninr, old.Acyear, old.Styear);
return NULL;
end;
' LANGUAGE 'plpgsql';
Then I wanted to create a trigger using this function with the properties :
Table T-Alumni
Executes AFTER
Event UPDATE, DELETE
For each ROW
Function trigfunc_add_alumni()
Then I get the error :
An error has occurred in pgAfdmin II:frmTrigger.cmdOK_Click : Number 5
Description : Invalid procedure call or argument
Can someone tell me what i'm doing wrong? Or is there another better solution for this problem?!
Thanks!!
Joepie Platteau.
I have the following problem :
I have 2 tables : T-Alumni and T-AlumniB (exact copy of Alumni, except 3 extra columns : user, date, time)
On events 'update' and 'delete' in table Alumni, I want to copy the old row to AlumniB (as a backuptable) and add the username, date and time.
So I created a function :
CREATE FUNCTION trigfunc_add_alumni() RETURNS opaque AS '
begin
insert into T-Alumni-B values (old.Id_Person, old.Member, old.Payed, old.Nr, old.Alumninr, old.Acyear, old.Styear);
return NULL;
end;
' LANGUAGE 'plpgsql';
Then I wanted to create a trigger using this function with the properties :
Table T-Alumni
Executes AFTER
Event UPDATE, DELETE
For each ROW
Function trigfunc_add_alumni()
Then I get the error :
An error has occurred in pgAfdmin II:frmTrigger.cmdOK_Click : Number 5
Description : Invalid procedure call or argument
Can someone tell me what i'm doing wrong? Or is there another better solution for this problem?!
Thanks!!
Joepie Platteau.
В списке pgsql-general по дате отправления: