Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Where is implicit pk index?
I'm under the understanding that when you make a primary key, a unique
index is created by Oracle. In one form of the syntax, I can't find it.
If I -
SQL> create table junk(a NUMBER primary key, b NUMBER);
Table created.
SQL> insert into junk values (1,2);
1 row created.
etc....
Commit complete.
SQL> select * from user_objects where object_name like '%JUNK%';
JUNK
3649 3649 TABLE27-JUN-99 27-JUN-99 1999-06-27:17:58:54 VALID N N But if I
SQL> create table junk (a NUMBER , b NUMBER);
Table created.
SQL> alter table junk
2 add constraint junkpk primary key (a);
Table altered.
SQL> select * from user_objects where object_name like '%JUNK%';
JUNK
3651 3651 TABLE27-JUN-99 27-JUN-99 1999-06-27:18:03:57 VALID N N JUNKPK
3652 3652 INDEX27-JUN-99 27-JUN-99 1999-06-27:18:04:24 VALID N N So where is the index in the first form of the syntax? I also tried dba_segments, dba_objects, dba_indexes, only 1 entry...