Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Constrainting NUMBER
as wrote:
> "DA Morgan" <damorgan_at_psoug.org> ??? news:1117085511.454471_at_yasure ???... >
> > 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.)
I've come across books with all kinds of fascinating advice. Taking that advice, however, requires application of synapses.
Take for example a date column. Would you let someone enter a DOB (date of birth) greater than the current date? How about one more than 150 years ago? ... I know depends on the system ... but at least you thought about it.
Lets say the column holds person's ages. Is there any value in NUMBER(4)? How about money? Is there any value in allowing more than two decimal points? ... Again ... it depends on the system ... but you need to think about it.
In my opinion there is a word for people that use NUMBER without application of gray matter ... the word is lazy. And why not consider the data type of FLOAT? Or REAL? The correct tool is now always a hammer.
-- Daniel A. Morgan Relational theory is not something that is simply a nice-to-have. http://www.psoug.org damorgan_at_x.washington.edu (replace x with u to respond)Received on Thu May 26 2005 - 08:58:39 CDT
![]() |
![]() |