I have two packages called Passenger and Booking. They have a one to many relationship. I encountered a circular dependency error when I tried to do with
in both of their files. I then tried limited with Passenger
and made the Booking record store Passenger as an access type.
package body Bookings is
procedure initialize_booking (b : in out Booking; flight : Unbounded_String; booker : Passengers.Passenger) is
begin
b.ID := nextID;
b.seat := nextSeat;
b.flight := flight;
b.booker := access booker;
nextID := nextID + 1;
end initialize_booking;
The above procedure is an example of how I am trying to store the access type in the booking record. I get a “missing operand” error.
Can someone please explain where I am going wrong?
An explanation on how to do a many-many or how I’d do it for the reverse way where I use a vector with access types of Booking stored in Passenger would be greatly appreciated too.
How can I use the access typed variable to access the object within and call its methods too?
Thanks for helping.