Received: from charon.simplot.com (jrsmailhub.simplot.com [12.18.144.212]) by postgresql.org (Postfix) with ESMTP id 5DBFE476589 for ; Thu, 11 Apr 2002 20:00:20 -0400 (EDT) Received: from xanadu.simplot.COM (151.113.0.132) by charon.simplot.com (MX V5.1-A AnGp) with SMTP; Thu, 11 Apr 2002 18:00:22 -0600 Received: from NPA01ZZ001.simplot.com by xanadu.simplot.COM; (5.65v4.0/1.1.8.2/20Aug97-1116AM) id AA25381; Thu, 11 Apr 2002 18:00:22 -0600 Received: from earlj by npa01zz001.simplot.com with local (Exim 3.35 #1 (Debian)) id 16voUE-0003ZQ-00; Thu, 11 Apr 2002 18:00:18 -0600 To: "Eric Carpenter" Cc: Subject: Re: Inserting values into numeric fields References: From: Jason Earl Date: 11 Apr 2002 18:00:15 -0600 In-Reply-To: Message-ID: <87y9ft23cg.fsf@npa01zz001.simplot.com> Lines: 19 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200204/145 X-Sequence-Number: 7410 "Eric Carpenter" writes: > Greetings all, > > I'm trying to insert values into a numeric field which may be > optional. I'm using perl's DBI and bind parameters to do > this. However, psotgresql complains that '' is not a numeric, since > the DBI quotes everything before inserting.. I've tried inserting > NULL as well, but that gets quoted and rejected as well. > > Is there any way to do this without hard coding "NULL" into the > prepared statement handle? It's been a long time since I used Perl with PostgreSQL but it seems DBI will insert null values if you pass them variables that are undefined. Try using undef() and see what you get. Good luck, Jason