Subject | Triggers to automagically add/modify/delete data in another table ? |
---|---|
Author | Adriano |
Post date | 2006-05-08T14:29:19Z |
Hi,
i've this elementary problem.
I've two table (table A and table B).
When add/modify/delete data in table A i need to add/modify/delete
(some data of table A) also in table B.
When use access database i put in table B a field in which i insert
the Unique ID of table A so that:
1) new data in table A: after insert new data (row) i detect Unique ID
and add also data and ID in table B
2) modify data in table A: i detect the unique ID, find it in table B
and modify data also in table B
3) deleta data in table A: i detect the unique ID, find it in table B
and delete data also in table B
With firebirs which is the best way to do that ?
Using a trigger ?
How to retreive the Unique ID of table A after the insert of a new row of data ?
Some example is avaible for that scenario ?
I use FB 2.x but cannot find the employee example database.
Thanks
Adriano
i've this elementary problem.
I've two table (table A and table B).
When add/modify/delete data in table A i need to add/modify/delete
(some data of table A) also in table B.
When use access database i put in table B a field in which i insert
the Unique ID of table A so that:
1) new data in table A: after insert new data (row) i detect Unique ID
and add also data and ID in table B
2) modify data in table A: i detect the unique ID, find it in table B
and modify data also in table B
3) deleta data in table A: i detect the unique ID, find it in table B
and delete data also in table B
With firebirs which is the best way to do that ?
Using a trigger ?
How to retreive the Unique ID of table A after the insert of a new row of data ?
Some example is avaible for that scenario ?
I use FB 2.x but cannot find the employee example database.
Thanks
Adriano