RE: no value for numeric filed in SQL statement causes an error

From: Michael Davis <mdavis(at)sevainc(dot)com>
To: "'juerg(dot)rietmann(at)pup(dot)ch'" <juerg(dot)rietmann(at)pup(dot)ch>, "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: RE: no value for numeric filed in SQL statement causes an error
Date: 2001-01-31 16:20:56
Message-ID: 01C08B67.21B84270.mdavis@sevainc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Try:

insert into table (name,id,city) values ('roger rabbit',NULL,'carrot city')

-----Original Message-----
From: juerg(dot)rietmann(at)pup(dot)ch [SMTP:juerg(dot)rietmann(at)pup(dot)ch]
Sent: Wednesday, January 31, 2001 7:16 AM
To: pgsql-sql(at)postgresql(dot)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
============================================

Browse pgsql-sql by date

  From Date Subject
Next Message mig 2001-01-31 16:23:01 Re: RE: Rownum/ row Id
Previous Message Ross J. Reedstrom 2001-01-31 15:50:24 Re: Permissions for foreign keys