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

Home -> Community -> Usenet -> c.d.o.server -> Re: Is the use of VARCHAR(256) as Primary Keys preferred in Oracle?

Re: Is the use of VARCHAR(256) as Primary Keys preferred in Oracle?

From: Pablo Sanchez <pablo_at_dev.null>
Date: Mon, 18 Nov 2002 04:35:16 GMT
Message-ID: <Xns92C9DB9A7997Epingottpingottbah@209.242.64.107>


"Paul Brewer" <paul_at_paul.brewers.org.uk> wrote in news:3dd8142b_1_at_mk-nntp-1.news.uk.worldonline.com:

> Personally, if a 'natural' VARCHAR2 key of reasonable length (say
> 4 to 12) were available, I for one would not be inclined to invent a
> numeric surrogate key.

I would dissuade folks from using natural keys as their primary key. Using surrogate keys gives the application a layer between the business (primary key) and the implementation (surrogate key).

Business rules change and what someone says will _never_ happen is ephemeral.

I would still use the natural key but as an alternate key with a UNIQUE constraint on it.

-- 
Pablo Sanchez, High-Performance Database Engineering
http://www.hpdbe.com
Received on Sun Nov 17 2002 - 22:35:16 CST

Original text of this message

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