pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ken J. Wright <ken@ori-ind.com>
To: pgsql-interfaces@postgreSQL.org
Cc: Constantin Teodorescu <teo@flex.ro>
Subject: Re: [INTERFACES] pgaccess & null dates
Date: Thu, 29 Apr 1999 10:10:51 -0700
Message-ID: <3.0.32.19990429101049.0085a740@ren.cncware.com> (raw)

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





view thread (5+ messages)  latest in thread

Message-ID: <3.0.32.19990429101049.0085a740@ren.cncware.com>
Permalink:  ../3.0.32.19990429101049.0085a740@ren.cncware.com/
Also on:    postgresql.org/message-id/3.0.32.19990429101049.0085a740@ren.cncware.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: ken@ori-ind.com, teo@flex.ro
  Subject: Re: [INTERFACES] pgaccess & null dates
  In-Reply-To: <3.0.32.19990429101049.0085a740@ren.cncware.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox