The RESERVDB user database contains two tables called XMLFLIGHTTB and XMLPASSENGERTB. The following figure shows how the XML_Reservation and XML_CancelReservation message flows modify the data in both tables, while the XML_PassengerQuery and XML_FlightQuery message flows only query the information and do not modify the data.
The purpose of the XMLFLIGHTTB table is to contain current information about the seats available on flights. When it is created, the XMLFLIGHTTB table is populated with data about the flights. The XML_Reservation and XML_CancelReservation message flows modify the data in the table.
The following table shows some information about the fields in XMLFLIGHTTB.
Field name | Data type | Null? | Content |
---|---|---|---|
FLIGHTDATE | CHAR | No | The date of the flight. |
FLIGHTNO | CHAR | No | The number of the flight. |
ECONOMICCLASS | INTEGER | No | The number of seats reserved in Economy class. |
FIRSTCLASS | INTEGER | No | The number of seats reserved in First class. |
TOTALECONOMIC | INTEGER | No | The number of seats available in Economy class. |
TOTALFIRST | INTEGER | No | The number of seats available in First class. |
ECONOMICPRICE | INTEGER | No | The price of seats in Economy class. |
FIRSTPRICE | INTEGER | No | The price of seats in First class. |
STARTPOINT | CHAR | No | The origin of the flight. |
ENDPOINT | CHAR | No | The destination of the flight. |
RESERVATIONSEQNO | INTEGER | No | The number of reservations made so far. The XML_Reservation message flow uses this number to generate unique reservation numbers for the passengers. |
When a passenger reserves a seat on a flight, the XML_Reservation message flow decreases the number of available seats in each class, which is shown in the TOTALECONOMIC and TOTALFIRST fields of the XMLFLIGHTTB table. The XML_Reservation message flow increases the number of reserved seats in the ECONOMICCLASS and FIRSTCLASS fields.
The RESERVATIONSEQNO for each row in the XMLFLIGHTTB table is "0" when the table is created and populated. The first time you run the XML_Reservation message flow using the first input message, the RESERVATIONSEQNO increases to "4" in each row of the table to show that four reservations have been made. The RESERVATIONSEQNO increases to "5" when you run the XML_Reservation message flow using the second input message. The RESERVATIONSEQNO is used to create the unique reservation numbers. The number in the RESERVATIONSEQNO fields does not decrease when reservations are canceled.
When the reservations are canceled, the XML_CancelReservation message flow increases the number of seats available, which is shown in the TOTALECONOMIC and TOTALFIRST fields, and decreases the number of reservations on the flight, which is shown in the ECONOMICCLASS and FIRSTCLASS fields.
The purpose of the XMLPASSENGERTB table is to contain current information about the passengers who have reserved seats on the flights listed in XMLFLIGHTTB. When it is created, the XMLPASSENGERTB table does not contain any data. The XML_Reservation and XML_CancelReservation message flows add and remove data from the table.
The following table shows some information about the fields in XMLPASSENGERTB.
Field name | Data type | Null? | Content |
---|---|---|---|
LASTNAME | CHAR | No | The last name of the passenger. |
FIRSTNAME | CHAR | No | The first name of the passenger. |
FLIGHTNO | CHAR | No | The number of the flight. |
FLIGHTDATE | CHAR | No | The date of the flight. |
CLASSTYPE | CHAR | No | The class of the seat that has been reserved. |
RESERVATIONNO | VARCHAR | No | The unique reservation number allocated by the XML_Reservation message flow. |
When a passenger reserves a seat on a flight, the XML_Reservation message flow adds to the XMLPASSENGERTB table a row for each passenger who has reserved a seat. The first XML_Reservation input message requests four reservations so four rows of data are added. The second input message requests one reservation so one row of data is added, making five rows of data in the table.
The RESERVATIONNO column contains the reservation numbers that have been automatically generated to uniquely identify the reservations. Every time you subsequently run the XML_Reservation message flow, the RESERVATIONSEQNO increases.
When the reservations are canceled, the XML_CancelReservation message flow removes the reservations from the XMLPASSENGERTB table. Cancelling reservations does not reset the RESERVATIONSEQNO field in the XMLFLIGHTTB table so that when new reservations are made, the reservation number in the RESERVATIONNO field of the XMLPASSENGERTB table is always unique.