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 with more than one column

Re: Primary key with more than one column

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Mon, 29 Jun 1998 14:08:27 GMT
Message-ID: <35979f94.3003148@192.86.155.100>


A copy of this was sent to "S,Erik" <e_at_technologist.com> (if that email address didn't require changing) On Sat, 27 Jun 1998 13:36:30 -0400, you wrote:

>Can someone please give me the CREATE TABLE syntax for creating a primary
>key that includes more than one column? I have no trouble creating a
>primary key with just one column, but the Oracle7 SQL documentation does not
>give an example including multiple columns.
>
>

create table foo
( x int,
  y int,
  z varchar2(200),
  constraint foo_pk primary key(x,y)
)
/

See the SQL Reference Manual, "Constraints" for examples of table level, versus column level, constraints.  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Mon Jun 29 1998 - 09:08:27 CDT

Original text of this message

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