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: <karmit_at_my-dejanews.com>
Date: Mon, 29 Jun 1998 04:44:56 GMT
Message-ID: <6n7648$pph$1@nnrp1.dejanews.com>


CREATE TABLE tab

(a varchar2(10),
 b varchar2(20),
 c decimal(5,0),
 d decimal(7,2),

CONSTRAINT pk_tab PRIMARY KEY key(a,b))
  1. All multicolumn constraint are written after the field definition.
  2. Do not forget the comma after the last field.
  3. You do not have to write CONSTRAINT name, you can write only PRIMARY KEY(field1,field2...).

Karmit

In article <6n61v6$g2v$2_at_csu-b.csuohio.edu>,   "S,Erik" <e_at_technologist.com> wrote:
>
> 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.
>
>

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Sun Jun 28 1998 - 23:44:56 CDT

Original text of this message

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