Database & Application Miscellaneous: Zero value cannot store in database

  • matrik02 / 104 / Sun, 07 Mar 2010 03:37:00 GMT / Comments (2)
  • I have field name "Category" and its is number data type. Why I cannot store zero value in the table, I want to store the value like this 0001 but it store the value in the "category" field as '1' .Why?
  • Keywords:

    zero, value, store, database, application

  • http://database.itags.org/database-application/158199/«« Last Thread - Next Thread »»
    1. 0001 is a text field - we would store that as VARCHAR(4).

      Leading 0's are not supported in a numeric type of field - those fields store numbers and leading 0's, being not significant, are simply discarded.

      szlamany | Wed, 05 Dec 2007 19:40:00 GMT |

    2. In other words, if you want the leading zero's change the field type from number to text, otherwise, those zeros will continue to be dropped.

      hack | Wed, 05 Dec 2007 19:41:00 GMT |