From tomcat-user-return-12088-qmlist-jakarta-archive-tomcat-user=jakarta.apache.org@jakarta.apache.org Mon Feb 25 16:42:25 2002 Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 53088 invoked from network); 25 Feb 2002 16:42:25 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 25 Feb 2002 16:42:25 -0000 Received: (qmail 11908 invoked by uid 97); 25 Feb 2002 16:42:04 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 11857 invoked by uid 97); 25 Feb 2002 16:42:03 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 11846 invoked from network); 25 Feb 2002 16:42:03 -0000 From: "Jim Urban" To: "Tomcat Users List" Subject: RE: integer value Date: Mon, 25 Feb 2002 10:41:50 -0600 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <00bb01c1be1a$278f3b90$81f87ccb@globalleafs> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Importance: Normal X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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: For additional commands: Troubles with the list: