Menu

#9 Parameter typecasting and results conversion.

open
nobody
None
5
2007-06-05
2007-06-05
No

The attached patch adds a sort of basic typecasting to the parameter values on the execute() procedure.

For example now a str('1') as a value for an INTEGER parameter works without throwing an exception.

It also has a little hack to enable the use of a 'date' value for a TIMESTAMP parameter (it just appends the needed 'time' string to make the string 'YYYY-mm-dd HH:MM:SS.NNNNNN').

Also, there is a double free() (glibc detected) when a cursor is closed or '= None'd so I removed the PyDel that seemed to be causing this error.

Compiles and works fine with DB2 Express-C and python2.5, and I've tested it with a django backend I'm also developing.

Discussion

  • Javier Villavicencio

    patch for DB2.py and _db2_module.c.

     
  • Javier Villavicencio

    Logged In: YES
    user_id=1632577
    Originator: YES

    I forgot to mention, it also converts result types (datetime and integer types only so far) to python types. This part still can be extended to even more types.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.