Quote (carteblanche @ Mar 2 2017 08:18pm)
you didn't specify the foreign keys. if you're getting "returns too many rows", that means you have a many-to-many relationship somewhere. you can use `where rownum = 1`, min(MinFee), `where exists`, or some other strategy. personally, i'd recommend not doing it in a trigger but rather in your app that inserts the rows.
Taking a entry database class so they want us to just understand them. The foreign keys are there I checked using user_constraints.
The models table has two columns that have two different min and max's for the two models.
Rather then hard code the model name, is there a way for sql to recognize what the model of the fee im updating or inserting? Reservations uses a foreign key BedID to reference Tanningbeds.BedID, and Tanningbeds uses a Tanningsbeds.Model FK to Model.Model. Would I have to use a join to make the connect?
Edit: I guess the purpose is so if a new model is entered in the Models table, the trigger would work for the new entry is well.
This post was edited by Zom8 on Mar 2 2017 08:26pm