Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Constrainting NUMBER
"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