Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: DBI Question

by lo_tech (Scribe)
on Aug 30, 2001 at 08:28 UTC ( #109003=note: print w/replies, xml ) Need Help??

in reply to DBI Question

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.


  • Log In?

    What's my password?
    Create A New User
    Node Status?
    node history
    Node Type: note [id://109003]
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others cooling their heels in the Monastery: (3)
    As of 2021-02-26 00:32 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found