Share

PyDB2 - Python DB2 Interface And Tools

Tracker: Patches

5 Parameter typecasting and results conversion. - ID: 1731609
Last Update: Comment added ( the_paya )

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.


Javier Villavicencio ( the_paya ) - 2007-06-05 18:50

5

Open

None

Nobody/Anonymous

None

None

Public


Comment ( 1 )




Date: 2007-06-05 18:53
Sender: the_paya


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 comment.

Attached File ( 1 )

Filename Description Download
paya-patch.diff patch for DB2.py and _db2_module.c. Download

Change ( 1 )

Field Old Value Date By
File Added 231862: paya-patch.diff 2007-06-05 18:50 the_paya