[CDBI] Trouble writing non-character fields

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

From: Mark McWiggins
Subject: [CDBI] Trouble writing non-character fields
Date: 21:55 on 08 Aug 2005
Hi All,

I presume this information is somewhere on the old mailing list but I 
can't get
to the archives, so I appreciate any guidance whatever ... I have Class::DBI
working fine (with PostgreSQL) for everything but writing non-character 
values.

If I try to write (for instance) a Date field, I get an error like:

    [Mon Aug 08 12:44:04 2005] [error] [asp] [23302] [error] 
1283472304899935Can't u
    pdate 1283472304899935: DBD::Pg::st execute failed: ERROR:  column 
"void_date" i
    s of type date but expression is of type character varying <--> 
HINT:  You will
    need to rewrite or cast the expression. <-->  [for Statement "UPDATE 
inforce <--
    > SET    void_date = ?, void_reason = ? <--> WHERE  certificate_no=? 
<--> " with
     ParamValues: 2='poker', 1='Class::Date->now', 3='1283472304899935'] 
at /usr/loc
    al/lib/perl5/site_perl/5.8.6/DBIx/ContextualFetch.pm line 51. <--> 
errDBD::Pg::s
    t execute failed: ERROR:  column "void_date" is of type date but 
expression is o
    f type character varying <--> HINT:  You will need to rewrite or 
cast the expres
    sion. <-->  [for Statement "UPDATE inforce <--> SET    void_date = 
?, void_reaso
    n = ? <--> WHERE  certificate_no=? <--> " with ParamValues: 
2='poker', 1='Class:
    :Date->now', 3='1283472304899935'] at 
/usr/local/lib/perl5/site_perl/5.8.6/DBIx/
    ContextualFetch.pm line 51. <--> , 
/usr/local/lib/perl5/site_perl/5.8.6/Apache/ASP.pm line 1518

Do I need to explicitly do something with 'deflate' for these 
non-character types?

Thanks in advance -- Class::DBI is a Great Thing and I'll be able to 
throw away a bunch more
SQL code when I can get these updates to work!

        -- 
        Mark McWiggins
mark@xxxxxxxxxxxx.xxx
425-369-8286 (home/cell/vm -- let ring)


_______________________________________________
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