Home » SQL & PL/SQL » SQL & PL/SQL » datatype for status like columns
datatype for status like columns [message #433331] Tue, 01 December 2009 11:24 Go to next message
miroconnect@yahoo.com
Messages: 202
Registered: April 2006
Senior Member
we use different status column in several tables for example RESOLUTION_STATUS,
should I use a number for status or a String like PENDING, COMPLETED, INITIATED

which is better and good practice ?
Re: datatype for status like columns [message #433332 is a reply to message #433331] Tue, 01 December 2009 11:39 Go to previous messageGo to next message
cookiemonster
Messages: 12320
Registered: September 2008
Location: Rainy Manchester
Senior Member
Are you ever likely to have to worry about multi-lingual apps?
i.e. will you ever have to translate your statuses into another language?

If you are (or might) then you need to store the status descriptions in a separate table and link to them via an ID.

I generally do that regardless. Even if I wasn't I probably won't store statuses as full words - just go for a single letter abbreviation. It decreases the chances of someone putting a typo in the data and breaking stuff.
Re: datatype for status like columns [message #433337 is a reply to message #433332] Tue, 01 December 2009 12:11 Go to previous messageGo to next message
miroconnect@yahoo.com
Messages: 202
Registered: April 2006
Senior Member
but no difference in performance when add a where condition for status column when number and non-number ?
Re: datatype for status like columns [message #433379 is a reply to message #433337] Wed, 02 December 2009 00:35 Go to previous message
Michel Cadot
Messages: 63806
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Unless you specify a status with hundred letters there is no visible difference.

Regards
Michel
Previous Topic: Can we call a stored function in the constraint of a table?
Next Topic: Using Trigger to maintain history
Goto Forum:
  


Current Time: Tue Sep 27 19:34:12 CDT 2016

Total time taken to generate the page: 0.12792 seconds