Home » Category » Database & Application Miscellaneous

Database & Application Miscellaneous: Zero value cannot store in database

104| Wed, 05 Dec 2007 09:32:00 GMT| matrik02| 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 & Tags: zero, value, store, database, application

URL: http://database.itags.org/database-application/158199/
 
«« Prev - Next »» 2 helpful answers below.
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 |

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 |

Database & Application Miscellaneous Hot Answers

Database & Application Miscellaneous New questions

Database & Application Miscellaneous Related Categories