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: Indexing by number or by varchar2

Re: Indexing by number or by varchar2

From: Chris Hamilton <toneczar_at_erols.com>
Date: 1998/03/31
Message-ID: <01bd5ce1$e3fc4640$73344b9b@chrish.hq.usace.army.mil>#1/1

Inaki Agirre <inaki.agirre_at_si.unirioja.es> wrote ...

> If I must implement some codification, does it pay to define the primary
> column as number or could I use a meaningful varchar2, say, (3) length.

Better to use number datatype. The sort order is always correct (with varchar2 you must pad with zeroes for sorting to occur properly), and you save a little bit of storage. And, it's easily populated with a sequence called by a before-insert trigger.

Chris



Chris Hamilton -- toneczar_at_erols.com
City of Washington Pipe Band
http://www.serve.com/cowpb/chamilton.html Received on Tue Mar 31 1998 - 00:00:00 CST

Original text of this message

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