您的位置:首页 > 其它

索引名称的唯一性

2016-04-15 16:40 274 查看
oracle的规定,在同一个SCHEMA下的对象是不能用相同的名字命名的,一般创建索引名用“表名_字段名”,这样能很快知道这个索引,是属于哪个表的。

col_index 在ORACLE中都叫对象,不能命名相同

例:

SQL> create table emp1 as select * from scott.emp;

Table created

SQL> create table emp2 as select * from scott.emp;

Table created

SQL> create index emp1_name_idx on emp1(ename);

Index created

SQL> create index emp1_name_idx on emp2(ename);

create index emp1_name_idx on emp2(ename)

ORA-00955: 名称已由现有对象使用

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: