Received: from cncware.whidbey.com (IDENT:root@cncware.whidbey.com [208.25.171.37]) by hub.org (8.9.3/8.9.1) with ESMTP id NAA09848 for ; Thu, 29 Apr 1999 13:08:16 -0400 (EDT) (envelope-from ken@ori-ind.com) Received: from ken (ken.cncware.com [192.168.61.201]) by cncware.whidbey.com (8.8.7/8.8.7) with SMTP id KAA16711; Thu, 29 Apr 1999 10:06:30 -0700 Message-Id: <3.0.32.19990429101049.0085a740@ren.cncware.com> X-Sender: ken_ori@ren.cncware.com X-Mailer: Windows Eudora Pro Version 3.0 (32) Date: Thu, 29 Apr 1999 10:10:51 -0700 To: pgsql-interfaces@postgreSQL.org From: "Ken J. Wright" Subject: Re: [INTERFACES] pgaccess & null dates Cc: "Constantin Teodorescu" Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 08:59 AM 4/29/99 -0700, you wrote: >PgAccess 0.96, RH5.2 > >When editing a table and clearing a datetime field in the grid, the update >fails because the update sql is not declaring the new value as null, but as >an empty string. > This fixes it, although it also makes an empty string a null. The lessor of evils I think, without changing to do some field type checking before the update. 1401c1401,1406 < set retval [sql_exec noquiet "update \"$mw($wn,tablename)\" set \"$fld\"='$sqlfldval' where oid=$oid"] --- > # set retval [sql_exec noquiet "update \"$mw($wn,tablename)\" set \"$fld\"='$sqlfldval' where oid=$oid"] > if {$sqlfldval == ""} { > set retval [sql_exec noquiet "update \"$mw($wn,tablename)\" set \"$fld\"= NULL where oid=$oid"] > } else { > set retval [sql_exec noquiet "update \"$mw($wn,tablename)\" set \"$fld\"='$sqlfldval' where oid=$oid"] > } Ken