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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Primary Key: Maximun number columns exceeded?

Re: Primary Key: Maximun number columns exceeded?

From: Michael Serbanescu <mserban_at_postoffice.worldnet.att.net>
Date: 1997/08/01
Message-ID: <33E17DCE.50D7@postoffice.worldnet.att.net>#1/1

You are out of luck. ORACLE enforces a PRIMARY KEY constraint through a unique index on the column(s) that make(s) up the primary key. The maximum number of columns in an index is 16, and your PK constraint has 32 columns. Maybe this max number of columns for an index will change with Oracle8, but I am not aware of such a new feature.

However, do you need all those 32 columns to UNIQUELY identify a row in your table ? That's what a PRIMARY KEY is for. It does not mean that you "need to have all the possible key columns...". For a more in-depth discussion about UNIQUE, CANDIDATE and PRIMARY KEYs, read any book that deals with normalization or relational database theory (C.J. Date's books are a good start).

Hope this helps.

Michael Serbanescu



Kelly wrote:
>
> Hello All!
>
> I am using a script to try to build a Primary Key constraint, and I got an
> error of:
>
> ORA-02257 Max # of columns exceeded.
>
> How do I raise the number of columns? This is on a join table looked at by a
> number of tables generated from a supertype/subtype entity relationship. I
> need to have all the possible key columns, don't I? The Reference said to
> remedy this I had to reduce the number of columns...but I think I need them.
> I am working with Personal Oracle 7. My Primary constraint script for this
> table look like this:
>
> PROMPT Adding PRIMARY Constraint To ADDRESS_ASSOCIATIONS Table
>
> ALTER TABLE ADDRESS_ASSOCIATIONS ADD (
> CONSTRAINT ADD_ASSOC_PK
> PRIMARY KEY (ADDRESS_ADDRESS_ID,
> BUSINESS_LISTING_NUMBER,
> BUSINESS_SECTION_NUMBER,
> BUSINESS_PAGE_NUMBER,
> BUSINESS_BOOK_BOOK_NUMBER,
> BUSINESS_BOOK_PUB_DATE,
> CHILD_LISTING_NUMBER,
> CHILD_SECTION_NUMBER,
> CHILD_PAGE_NUMBER,
> CHILD_BOOK_BOOK_NUMBER,
> CHILD_BOOK_PUB_DATE,
> DESC_BOOK_BOOK_NUMBER,
> DESC_BOOK_PUB_DATE,
> DESC_LISTING_NUMBER,
> DESC_SECTION_NUMBER,
> DESC_PAGE_NUMBER,
> GOV_LISTING_NUMBER,
> GOV_SECTION_NUMBER,
> GOV_PAGE_NUMBER,
> GOV_BOOK_BOOK_NUMBER,
> GOV_BOOK_PUB_DATE,
> INDIVIDUAL_BOOK_BOOK_NUMBER,
> INDIVIDUAL_BOOK_PUB_DATE,
> INDIVIDUAL_LISTING_NUMBER,
> INDIVIDUAL_SECTION_NUMBER,
> INDIVIDUAL_PAGE_NUMBER,
> OTHER_BOOK_BOOK_NUMBER,
> OTHER_BOOK_PUB_DATE,
> OTHER_LISTING_NUMBER,
> OTHER_SECTION_NUMBER,
> OTHER_PAGE_NUMBER,
> INDIVIDUAL_INDIVIDUAL_TYPE)
> USING INDEX
> PCTFREE 10)
> /
> Can anyone offer some suggestions? What is the limit and can I raise it? If
> so, how?
>
> TIA!!
>
> Kelly
> kgrigg_at_acxiom.com
>
> ps. Please CC by mail too..our newsfeed still isn't reliable.
>
> "If you've had half as much fun as me...
> ....Then I've had twice as much fun as you!!"
>
> kgrigg_at_acxiom.com
> cayenne_at_cei.net
>
> Visit my Website at: http://www.cei.net/~cayenne/index.html
Received on Fri Aug 01 1997 - 00:00:00 CDT

Original text of this message

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