X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id F2E299FA4A7 for ; Wed, 19 Jul 2006 22:06:24 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 13469-03 for ; Wed, 19 Jul 2006 22:06:14 -0300 (ADT) X-Greylist: delayed 00:19:44.140781 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 4225A9FA6AF for ; Wed, 19 Jul 2006 22:06:14 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from pgdu.pipolfastaem.gov.sb (pgdu.pipolfastaem.gov.sb [202.1.164.253]) by svr4.postgresql.org (Postfix) with ESMTP id 6F1AA5AFB32 for ; Thu, 20 Jul 2006 00:46:22 +0000 (GMT) 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 11:42:54 +1100 Subject: Insert NULL value with to_numeric() From: Ghislain Bob Hachey To: pgsql-admin@postgresql.org Content-Type: text/plain Date: Thu, 20 Jul 2006 11:51:54 +1100 Message-Id: <1153356715.2234.342.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 00:42:54.0365 (UTC) FILETIME=[6FF82CD0:01C6AB95] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/159 X-Sequence-Number: 22405 Hello all, I'm a newbie. PostgreSQL 8.1.4. Fedora Core 5. I'm writing a small java application that will import CSV txt files into my DB. The SQL statement I'm sending to pgsql looks like this: "INSERT into table (col1,col2,col3) values (to_number(?, '999'),to_timestamp(?, 'MM/DD/YYYY HH24:MI:SS'),to_number(?, '9999'); Values are taken from a String array. sometimes in col3 (smallint in pgsql DB) I need to insert a NULL value but when I do I get the following error message: invalid input syntax for type numeric: " " I've search the archives and Internet and found similar situations but I guess not experienced enough to fix this myself with info that I've found. Any help would be greatly appreciated. Regards, Ghislain Hachey