It's been my experience that the DBD will attempt to convert (mangle?) the DTS when attempting an insert in Informix if the formats are not defined in exactly the same format, for example if the field is defined in the table as 'year to second' vs. 'year to fraction' it will still accept, but YMMV.

I've been able to get past some of these pitfalls by

  • 1) checking the field format via dbaccess, and making sure my discrete values are valid for that field definition, or
  • 2) doing an insert using the Informix keyword CURRENT
       eg. 'INSERT INTO foo_table (field1,field2) VALUES (?, CURRENT)

    Note that the current time on the host running perl might not be the db servers current time. We run everything UTC so sometimes I forget others dont.

    I've also had success selecting from the database using EXTEND(field2, year to second).

    While I know that extending the field doesn't help your question, it has saved me a lot of regexes when selecting elements of the DTS from the db.

    Onward!


    In reply to Re: DBI Question by lo_tech
    in thread DBI Question by Jocko

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.