Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: What's wrong with this SQL?
Bent Stigsen wrote:
>
> [snip]
> >>>>>I greatly dislike in-line constraint creation which is what you are
> >>>>>doing and would suggest you just build the table and then use ALTER
> >>>>>TABLE to create your primary key and other constraints. There is no
> >>>>>need to be building an index that already exists.
> [snip]
>
> Do as Daniel says.
>
> What they do make little sense. Toss the inline primary key and the
> create index. Instead do...
>
> ALTER TABLE ss_sessionspec5
> add CONSTRAINT XIE1ss_sessionspec5 PRIMARY KEY (sessionid);
>
> /Bent
Bent,
Ok, I think I see.
Synopsis:
Questions:
I'm assuming that when the "ALTER TABLE" makes "sessionid" the primary key, that this creates an index. Is this correct?
Also, in Oracle, is the constraint "XIE1ss_sessionspec5" that results from "ALTER TABLE" treated EXACTLY the same as if it were an INDEX after that?
Sorry for all the questions...
Jim Received on Fri Jan 14 2005 - 09:09:36 CST
![]() |
![]() |