作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2006, Vol. 32 ›› Issue (12): 55-56,59.

• 软件技术与数据库 • 上一篇    下一篇

数据库表中流水号触发器的研究

颜波 1,孙宏波2,黄必清2,肖田元2   

  1. 1. 华南理工大学电子商务学院,广州510006;2. 清华大学自动化系,北京 100084
  • 出版日期:2006-06-20 发布日期:2006-06-20

Research on Trigger’s Serial Numbers of Database Tables

YAN Bo1, SUN Hongbo2, HUANG Biqing 2, XIAO Tianyuan2   

  1. 1. College of E-business, South China University of Technology, Guangzhou 510006;2. Department of Automation, Tsinghua University, Beijing 100084
  • Online:2006-06-20 Published:2006-06-20

摘要: 在信息系统的数据库表中用流水号做主键可以提高效率。选择创建触发器来完成流水号的自动增加一方面能够回滚,另一方面流水号可以是数字型、字符型和字符串型,分别适合数据记录增量大和增量小的数据表、流水号需要左填充的数据表。测试表明,该文提出的方法是可行的、有效的。

关键词: 管理信息系统;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