Why did you declare a phone number as integer? I've seen phone numbers declared as char 10 (unformatted), char 14 (formatted) or even varchar, but never integer. If you use a char type field you can define the field as null able too, which solves your problem.
Jim > -----Original Message----- > From: Uma Maheswar [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 25, 2002 10:32 AM > To: Tomcat Users List > Subject: integer value > > > Hi, > I have a doubt, I have a form that has name and his phone number, > both the fields are optional. I declared name as VARCHAR and > number as INTEGER in my SQL database. When the user leaves the > fild empty, I get an error with the number field as > NumberFormatException. > > So , What I need to do now is, when the user leaves the field > null or blank, I wanted to insert a default value into the > database. For eg. > > If(number == null) > { > number = 000000; > } > if(name==null) > { > name="tomcat"; > } > > I know the number if statement will give error.But could you > please help me with this? > > Uma > -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>
