Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to check values between IGs

Hi developers.

I have the followings IGs (table Flights and table Crew). It is a Master-Detail relationship, that is a Flight can have many crew's components. The PK in the table Flights is IDFlight, the FK in the Crew table is IDFlight (PK is IDCrew).

Master-Detail.png

As you can see the table Flights has 4 columns (VFR, VFRN, IFR and IMC) that indicate the way a flight goes on. The sum of these 4 gives the flight duration (in this example is 30 minutes).

Even the table Crew has the same 4 columns and indicate the way a pilot drives the plane. The values in these 4 columns can be different from those in the Flights table (parent's records), but the sum of them must be equal to the duration of the flight.

What I need is to check that the sum of the Crew table's fields (VFR, VFRN, IFR and IMC) must be equal to the sum of the its parent fields (VFR, VFRN, IFR and IMC). If not, the saving must be not possible (a warning message but be raised).

I was thinking about a constraint CHECK between two tables, but I believe it is not possible. Then, I must do this in the IGs fields.

Thank you for any kind of help.

Sergio

This post has been answered by Madhwal.17 on Jun 13 2023
Jump to Answer
Comments
Post Details
Added on Jun 12 2023
13 comments
401 views