• Post Reply Bookmark Topic Watch Topic
  • New Topic

Allow number to start with ZERO when stored in mysql text field  RSS feed

 
Nidheesh Krishna
Ranch Hand
Posts: 62
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to store phone numbers starting with 0 but whenever i try to store this in MySql table the starting ZERO is removed because no number start with Zero actually
how i can solve this problem please do i need to change the field type from Integer to another type
 
khadar valli
Greenhorn
Posts: 26
Java MySQL Database Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Krishna,

Please modify the datatype of that column of phonenumber to varchar2 and insert the phone number in the string format. I hope this will work fine.

Regards,
Khadar
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!