Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Naming Primary Key Indexes
hi
you can name the constraint in the create table command, so that the index will be created with the constraint name. Use table-constraint syntax instead of column-constraint syntax. for example you can use
create table t1
(col1 datatype,
col2 ...
coln datatype,
constraint t1_pk primary key ( col1 ) using index tablespace .... );
this will create your primary key index with the name of the constraint ( t1_pk in the example)
hope this helps
Vishal
stuco_at_mailcity.com wrote:
> 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
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
Received on Thu Jun 18 1998 - 21:52:39 CDT