摘要: 在信息系统的数据库表中用流水号做主键可以提高效率。选择创建触发器来完成流水号的自动增加一方面能够回滚,另一方面流水号可以是数字型、字符型和字符串型,分别适合数据记录增量大和增量小的数据表、流水号需要左填充的数据表。测试表明,该文提出的方法是可行的、有效的。
关键词:
管理信息系统;Oracle 数据库;触发器;流水号;物流工程
Abstract: Regarding a serial number as a primary key in the database tables of the logistics information system can increase efficiency. On the one hand, that creating triggers is chosen to fulfill automotive increase of the serial number could rollback, on the other hand, the serial number may be a number type, a char type and a string type and fit respectively for database tables where data records increasing rapidly and slowly, and those serial numbers need padding on the left. It is proved that the design is available and feasible.
Key words:
Management information system (MIS); Oracle database; Trigger; Serial number; Logistics engineering
颜波,孙宏波,黄必清,肖田元. 数据库表中流水号触发器的研究[J]. 计算机工程, 2006, 32(12): 55-56,59.
YAN Bo1, SUN Hongbo, HUANG Biqing , XIAO Tianyuan. Research on Trigger’s Serial Numbers of Database Tables[J]. Computer Engineering, 2006, 32(12): 55-56,59.