国防科大数据库第八章:事务管理(1)(8)
发布时间:2021-06-05
发布时间:2021-06-05
完成此功能的事务实现如下(嵌入式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.
下一篇:五金件安装