Answer the question
In order to leave comments, you need to log in
Create trigger to insert into view?
There is a table stations (st_id, st_name)
The second table rotes (route_id, start_station, end_station)
Created a view
CREATE VIEW routes_view AS
SELECT r.route_id, s1.st_name, s2.st_name
FROM routes r
JOIN stations s1 ON (r.start_station = s1.st_id)
JOIN stations s1 ON (r.end_station = s2.st_id) ;
CREATE OR REPLACE TRIGGER routes_view_insert
INSTEAD OF INSERT ON routes_view ....
Answer the question
In order to leave comments, you need to log in
In order for this trigger to work for you, at least you need to list the required fields in the view. Those. from stations you need to add 2 st_id (primary keys). And you can take everything else from the documentation https://docs.oracle.com/cd/B19306_01/server.102/b1... in the examples.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question