[CDBI] Trouble writing non-character fields

Mark McWiggins mark at IcanFixYourEmail.com
Mon Aug 8 22:55:17 BST 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 at cheaperemail.com
425-369-8286 (home/cell/vm -- let ring)





More information about the ClassDBI mailing list