Developer设置自动增量列

Developer设置自动增量列

本文介绍了如何使用SQL Developer设置自动增量列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置列以使用Oracle SQL Developer自动增加?为什么禁用表单?

How do I set a column to increment automatically with Oracle SQL Developer? Why is the form disabled?

注意:该图显示了Data Modeler,但是问题和最重要的答案是关于编辑现有数据库的信息.

Note: The image shows the Data Modeler, but the question and top answer talk about editing an existing database.

推荐答案

如果要使PK自动递增,则需要为该主键设置ID列属性.

If you want to make your PK auto increment, you need to set the ID column property for that primary key.

  1. 右键单击表格,然后选择编辑".
  2. 在编辑"表窗口中,选择列",然后选择您的PK列.
  3. 转到"ID列"选项卡,然后选择列序列"作为类型".这将创建一个触发器和一个序列,并将该序列关联到主键.
  1. Right click on the table and select "Edit".
  2. In "Edit" Table window, select "columns", and then select your PKcolumn.
  3. Go to ID Column tab and select Column Sequence as Type. This willcreate a trigger and a sequence, and associate the sequence toprimary key.

请参阅下面的图片以更好地理解.

See the picture below for better understanding.

//我的来源是: http://techatplay.wordpress.com/2013/11/22/oracle-sql-developer-create-auto-incrementing-primary-key/

这篇关于如何使用SQL Developer设置自动增量列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 18:50