如何使用SQL Developer设置自动增量列 [英] how to set auto increment column with sql developer

查看:85
本文介绍了如何使用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 PK column.
  3. Go to ID Column tab and select Column Sequence as Type. This will create a trigger and a sequence, and associate the sequence to primary key.

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

See the picture below for better understanding.

//我的来源是: 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆