About the RESERVDB database

The RESERVDB user database contains two tables called XMLFLIGHTTB and XMLPASSENGERTB. The following diagram shows how the XML_Reservation and XML_CancelReservation message flows modify the data in both tables, but the XML_PassengerQuery and XML_FlightQuery message flows query the information only and do not modify the data.

A diagram summarizing the interactions between the message flows and the user database.

The XMLFLIGHTTB table

The XMLFLIGHTTB table contains 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 value in the RESERVATIONSEQNO field for each row in the XMLFLIGHTTB table is "0" when the table is created and populated. The first time that you run the XML_Reservation message flow by using the first input message, the value in the RESERVATIONSEQNO field increases to "4" in each row of the table to show that four reservations have been made. The value in the RESERVATIONSEQNO field increases to "5" when you run the XML_Reservation message flow by using the second input message. The RESERVATIONSEQNO field is used to create the unique reservation numbers. The value in the RESERVATIONSEQNO field 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 XMLPASSENGERTB table

The XMLPASSENGERTB table contains 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 a row to the XMLPASSENGERTB table for each passenger who has reserved a seat. The first XML_Reservation input message requests four reservations so that four rows of data are added. The second input message requests one reservation so that one row of data is added, making five rows of data in the table.

The RESERVATIONNO field 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 value in the RESERVATIONSEQNO field 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.

Back to About the Airline Reservations sample