tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Urban" <jim.ur...@netsteps.net>
Subject RE: integer value
Date Mon, 25 Feb 2002 16:41:50 GMT
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:help@globalleafs.com]
> 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:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message