Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Naming Primary Key Indexes
>Subject: Naming Primary Key Indexes
>From: stuco_at_mailcity.com
>Date: 6/18/98 07:19 GMT
>Message-id: <6mbp8i$c7r$1_at_nnrp1.dejanews.com>
>
>I am using DDL in a way that creates primary keys in ths same 'CREATE TABLE'
>statement. I can designate a specific tablespace for that index, however, I
>am having trouble giving that index a meaningful name!
>
>I know I can create the table then create a primary key index with a name,
>but
>that's real ANNOYING to me.
>
>I also know that I can mess around with the sys.obj$ view to rename those
>cryptic indexes, but (YIKES) that seems to scary!
>
>Is there a way to give primary key indexes a NAME in the same statement as
>'CREATE TABLE'????
>
>If not, do I risk being annoyed out of my gourd, or risk getting fired
>(hmmmm...let's really think about that one! :) ).
>
>Thank you, Oh Great Community of Oracle Experts!!
>
>Stuart L. Cowen
>Paladin Consulting - Dallas
>
Hi Stuart,
Try,
CREATE TABLE (
first column ...,
...
last column,
constraint primary_key_name primary key (pk_column1,...,pk_column_n) using
index tablespace ... )
HTH,
Rob
Received on Thu Jun 18 1998 - 16:23:59 CDT