From: | "Ken J(dot) Wright" <ken(at)ori-ind(dot)com> |
---|---|
To: | pgsql-interfaces(at)postgreSQL(dot)org |
Cc: | "Constantin Teodorescu" <teo(at)flex(dot)ro> |
Subject: | Re: [INTERFACES] pgaccess & null dates |
Date: | 1999-04-29 17:10:51 |
Message-ID: | 3.0.32.19990429101049.0085a740@ren.cncware.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Oliver Elphick | 1999-04-29 17:24:09 | Re: [INTERFACES] RPM for PgAccess 0.96 |
Previous Message | Ken J. Wright | 1999-04-29 15:59:15 | pgaccess & null dates |