Received: from mail01.phoenixdsl.com (mail.phoenixdsl.com [216.178.151.24]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f0VGL7q50206 for ; Wed, 31 Jan 2001 11:21:07 -0500 (EST) (envelope-from mdavis@sevainc.com) Received: (qmail 91385 invoked by uid 89); 31 Jan 2001 16:21:03 -0000 Received: from unknown (HELO SALLY) (64.32.157.45) by 0 with SMTP; 31 Jan 2001 16:21:03 -0000 Received: by localhost with Microsoft MAPI; Wed, 31 Jan 2001 09:21:02 -0700 Message-ID: <01C08B67.21B84270.mdavis@sevainc.com> From: Michael Davis Reply-To: "mdavis@sevainc.com" To: "'juerg.rietmann@pup.ch'" , "pgsql-sql@postgresql.org" Subject: RE: no value for numeric filed in SQL statement causes an error Date: Wed, 31 Jan 2001 09:20:56 -0700 Organization: Seva Inc. X-Mailer: Microsoft Internet E-mail/MAPI - 8.0.0.4211 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Archive-Number: 200101/481 X-Sequence-Number: 1157 Try: insert into table (name,id,city) values ('roger rabbit',NULL,'carrot city') -----Original Message----- From: juerg.rietmann@pup.ch [SMTP:juerg.rietmann@pup.ch] Sent: Wednesday, January 31, 2001 7:16 AM To: pgsql-sql@postgresql.org Subject: no value for numeric filed in SQL statement causes an error Hi there I have a table with char and int fields. From my form I get no values back for int fields when they are left blank. This causes the SQL insert to fail. field type name char id int2 city char insert into table (name,id,city) values ('roger rabbit',,'carrot city') The default for int/float fields is 0. Since I reuse the code of the referring page I don't like to have all fields assigned 0 at the beginning. Who can help ??? Thanks ... jr ============================================ PFISTER + PARTNER, SYSTEM - ENGINEERING AG Juerg Rietmann Grundstrasse 22a 6343 Rotkreuz Switzerland phone: +4141 790 4040 fax: +4141 790 2545 mobile: +4179 211 0315 ============================================