完成此功能的事务实现如下(嵌入式SQL语言):
Begin_transaction ReservationBegin
input(flight_no, date, customer_name); (1)EXEC SQL UPDATE FLIGHT (2)
SET STSOLD = STSOLD+1WHERE FNO = flight_noAND DATE = date;
EXEC SQL INSERT (3)
INTO FC(FNO,DATE,CNAME,SPECIAL)VALUES(flight_no, date, customer_name, null);output(“reservation completed”) (4) End.