[CDBI] Re: Trouble writing non-character fields

[prev] [thread] [next] [Date index for 2005/08/09]

From: Edward J. Sabol
Subject: [CDBI] Re: Trouble writing non-character fields
Date: 00:12 on 09 Aug 2005
>> I think you need to tweak the SQL. Take a look at
>> http://wiki.class-dbi.com/index.cgi?SettingDefaultValues
>
> Thanks, but in this case I'm not creating a new record but updating
> one. The set_sql() function looks to assume you're doing a SELECT.

I think you didn't look closely enough. Look for the text "If you wanted to
do something similar for UPDATEs, you would override the 'update' SQL".

> The standard 'update' method shows itself in the doc, but there's no 
> indication of how to do
>
>     if typeof thing-to-update == DATE
>     {
>        CAST %S as "date"
>     }
>     else
>     {
>        %s
>     }
>
> inside the SQL ...

Class::DBI doesn't support that, out of the box, because that's
DBMS-specific. But I think you can override the SQL on a per-class basis as
that Wiki page suggests.

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] Trouble writing non-character fields
Mark McWiggins 21:55 on 08 Aug 2005

[CDBI] Re: Trouble writing non-character fields
Edward J. Sabol 23:04 on 08 Aug 2005

Re: [CDBI] Re: Trouble writing non-character fields
Mark McWiggins 00:04 on 09 Aug 2005

[CDBI] Re: Trouble writing non-character fields
Edward J. Sabol 00:12 on 09 Aug 2005

Re: [CDBI] Trouble writing non-character fields
William Ross 09:45 on 09 Aug 2005

Generated at 13:17 on 19 Aug 2005 by mariachi v0.52