Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Where is implicit pk index?
In article <3776A263.4345C932_at_bigfoot.com>,
Doug Cowles <dcowles_at_bigfoot.com> wrote:
> 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....
If you do not supply a name for the primary key, Oracle supplies one.
Look in the same tablespace where the data segment is for an object with
a name like sys_c followed by several digits. Your first try did not
supply a name for the primary key. Your second try did.
HTH
> Commit complete.
>
> SQL> select * from user_objects where object_name like '%JUNK%';
>
> JUNK
> 3649 3649 TABLE
> 27-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 TABLE
> 27-JUN-99 27-JUN-99 1999-06-27:18:03:57 VALID N N
>
> JUNKPK
> 3652 3652 INDEX
> 27-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...
>
> - Dc.
>
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Mon Jun 28 1999 - 07:04:49 CDT
![]() |
![]() |