Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: What's wrong with this SQL?

Re: What's wrong with this SQL?

From: ohaya <ohaya_at_cox.net>
Date: Fri, 14 Jan 2005 10:09:36 -0500
Message-ID: <41E7E0B0.6417A160@cox.net>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US