Hi, all!
I am trying to create a trigger to update a field on a "son" table
when a linked field (foreign key) is modified on a table "father".
example:
table son: table father:
--------------------- ------------------------
id /-----< id
description / name
son_id <----------/ address
... ...
--------------------- ------------------------
I see there's a check_foreign_key() function doing the following:
CASCADE - to delete corresponding foreign key,
RESTRICT - to abort transaction if foreign keys exist,
SETNULL - to set foreign key referencing primary/unique key
being deleted to null)
I need to implement a MODIFY clause to set 'son.son_id' equal to 'father.id'
when 'father.id' is updated.
I'm not a C-programmer, then I created a SQL function, but seems that
TRIGGER doesn't recognize SQL functions.
Am I right ?
Thanks, Jose'