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: Constrainting NUMBER

Re: Constrainting NUMBER

From: as <none_at_asgmeail.com>
Date: Thu, 26 May 2005 14:02:15 +0800
Message-ID: <429566ac$1_2@rain.i-cable.com>

"DA Morgan" <damorgan_at_psoug.org> ??? news:1117085511.454471_at_yasure ???...
>
> Best practice is to enforce data integrity in everything you do.
> That means define your data types after careful consideration and
> study of the data they will be asked to hold.
>
> The alternative is to do the following:
> CREATE TABLE bad_practice (
> person_id NUMBER,
> first_name VARCHAR2(4000),
> last_name VARCHAR2(4000),
> address VARCHAR2(4000),
> socsecno VARCHAR2(4000));
>
> does that make any sense? A Social Security Number of up to 4000
> bytes?
> --

Well, putting unconstrainted VARCHAR2 is definitely a bad practice - consider how sqlplus format the column. But for NUMBER, I do come across a textbook suggesting not to constraint it unless there is some good reasons - however the reasons are not clearly explained. (If you want to know, it is Oreilly's Java Programming with Oracle JDBC by Donald Bales Chap 10.2.) Received on Thu May 26 2005 - 01:02:15 CDT

Original text of this message

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