X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 54D589FA4A7 for ; Thu, 20 Jul 2006 00:42:42 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 78193-03 for ; Thu, 20 Jul 2006 03:42:32 +0000 (UTC) X-Greylist: delayed 02:56:22.257873 by SQLgrey- Received: from pgdu.pipolfastaem.gov.sb (pgdu.pipolfastaem.gov.sb [202.1.164.253]) by postgresql.org (Postfix) with ESMTP id 2AF6B9F9316 for ; Thu, 20 Jul 2006 00:42:23 -0300 (ADT) Received: from informationmanagement.pfnet.local ([202.250.250.160]) by pgdu.pipolfastaem.gov.sb with Microsoft SMTPSVC(6.0.3790.1830); Thu, 20 Jul 2006 14:39:09 +1100 Subject: Re: Insert NULL value with to_numeric() From: Ghislain Bob Hachey To: Aaron Bono Cc: pgsql-admin@postgresql.org In-Reply-To: References: <1153356715.2234.342.camel@informationmanagement.pfnet.local> Content-Type: text/plain Date: Thu, 20 Jul 2006 14:48:11 +1100 Message-Id: <1153367291.2234.356.camel@informationmanagement.pfnet.local> Mime-Version: 1.0 X-Mailer: Evolution 2.6.0 (2.6.0-1) Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 20 Jul 2006 03:39:09.0281 (UTC) FILETIME=[0F1C4D10:01C6ABAE] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/161 X-Sequence-Number: 22407 > > Why use to_number or to_timestamp? I assume you are using setString > in your prepared statement. In your Java code you can use setNull if > the value is null and setInt or setLong or setTimestamp if it is not. > Then you don't need the to_number or to_timestamp. You're absolutely right. I was trying to make it work with setString first cause I'm new to java and it was easier at first look. But I will take your advice. Thanks a lot for your time Ghislain Hachey >