RE: Storing single numbers in the database

  • From: "Baumgartel, Paul" <paul.baumgartel@xxxxxxxxxxxxxxxxx>
  • To: "'sbecker6925@xxxxxxxxx'" <sbecker6925@xxxxxxxxx>, "oracle-l" <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 5 Jun 2007 19:50:27 +0100

I agree with you, Sandy.  Yes, it does matter, particularly because this kind 
of thing leads to implicit type conversions, which can cause all sorts of 
heartache.
 
The developer doesn't want to translate?  What, he thinks 0 and 1 are letters?
 
Paul Baumgartel 
CREDIT SUISSE 
Information Technology 
Securities Processing Databases Americas 
One Madison Avenue 
New York, NY 10010 
USA 
Phone 212.538.1143 
paul.baumgartel@xxxxxxxxxxxxxxxxx 
www.credit-suisse.com 
 

  _____  

From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On 
Behalf Of Sandra Becker
Sent: Tuesday, June 05, 2007 2:08 PM
To: oracle-l
Subject: Storing single numbers in the database


Linux RHEL4, Oracle 9.2.0.8 <http://9.2.0.8> 
 
I have a developer who wants to define a column as CHAR(1) in an existing 
table.  The only values this will ever hold are zero and one.  I asked why he 
didn't define it as NUMBER(1) and the response was "Because I don't want to do 
the translation in my code."  He believes that the column in this table will be 
heavily used when it gets to production.  Since it's a new feature for the 
application, we have no way of knowing for sure how the customers will use it.  
They're kind of funny about deciding for themselves how they want to use the 
features. 
 
Questions:  Does it really matter if it's stored as NUMBER(1) or CHAR(1)?  What 
are the ramifications, if any, of defining the column as CHAR(1)?
 
I personally believe that if you want to store a numerical value and ONLY a 
numerical value in a column, you should define the column as NUMBER.
 
Sandy
 
 

==============================================================================
Please access the attached hyperlink for an important electronic communications 
disclaimer: 

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================

Other related posts: