Re: [INTERFACES] pgaccess & null dates - Mailing list pgsql-interfaces

From Ken J. Wright
Subject Re: [INTERFACES] pgaccess & null dates
Date
Msg-id 3.0.32.19990429101049.0085a740@ren.cncware.com
Whole thread Raw
List pgsql-interfaces
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




pgsql-interfaces by date:

Previous
From: "Ken J. Wright"
Date:
Subject: pgaccess & null dates
Next
From: "Oliver Elphick"
Date:
Subject: Re: [INTERFACES] RPM for PgAccess 0.96