Quote:
Originally posted by fantomen66
Hi Tony,
I must admite that I am quite new to triggers.
1. This link: http://technet.oracle.com/docs/prod...dg13trg.htm#376
was down when I tried.
2. The reason for this trigger is that I have a fares table where I need to put a travelling from city, and put a travelling to city. They exist as foreign keys in the fares table. Both the city paires have their own table. What i want to do is that when i register a city in the table tblFromCity I want the same values be insterted in the table tblToCity. Thata why I need a trigger for insert, update.
|
1. I'll try that link again:
http://technet.oracle.com/docs/produ...g13trg.htm#376
2. That makes no sense to me. If the Fare table has a from_city and a to_city, then BOTH columns should be foreign keys to the same table City:
CREATE TABLE City( City_ID NUMBER PRIMARY KEY, ...)
CREATE TABLE Fare( From_City_ID REFERENCES City,
To_city_ID REFERENCES City, ...)