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 Keys - multiple columns

Re: Primary Keys - multiple columns

From: Daniel Clamage <dclamageNOSPAM_at_telerama.com>
Date: 28 Jun 1998 18:41:12 +0400
Message-ID: <01bda2bb$e4d76f70$6829c9cd@saturn>


Don't put the primary key constraint in the create table -- do it with an alter table statement after the create table statement. You can easily configure multicolumn primary keys this way. It's simpler and more maintainable.
Once you do this, go to my web site (www.telerama.com/~dclamage) to download a PL/SQL package that reverse engineers database objects. It will display the correct syntax for adding constraints this way. It's also a good learning tool -- see how constraint info is stored in the data dictionary (what's exposed of it anyway). All the source is there to see, free. It's under the page for chapter 11 of the PL/SQL code for the chapters I wrote for Que Publishing (go to News section).

S,Erik <e_at_technologist.com> wrote in article <6n61v6$g2v$2_at_csu-b.csuohio.edu>...
> Can someone please tell me the CREATE TABLE syntax for creating a primary
> key that includes more than one column. I'm not having any problems
> creating PKs with just one column, but cannot find the right syntax for
two
> or more columns. The Oracle7 SQL documentation does not give an example
for
> this.
>
>
>
>
Received on Sun Jun 28 1998 - 09:41:12 CDT

Original text of this message

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