Re: [INTERFACES] pgaccess & null dates
| От | Ken J. Wright |
|---|---|
| Тема | Re: [INTERFACES] pgaccess & null dates |
| Дата | |
| Msg-id | 3.0.32.19990429101049.0085a740@ren.cncware.com обсуждение исходный текст |
| Список | 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 по дате отправления: