Python-DB2 module and DB2 Connect

Steve Williams stevewilliams at wwc.com
Sat Mar 16 06:32:02 EST 2002


=?ISO-8859-15?Q?Michael_Str=F6der?= wrote:

> Michael Ströder wrote:
> >
> > Anyone here which had success with using DB2-Python-0.991 (see
> > ftp://people.linuxkorea.co.kr/pub/DB2/) build against DB2 Connect?
>
> Seems to work. (DB2 Connect under Linux against DB2 OS/390 6.x)
>
> Ciao, Michael.

With DB2 UDB EE 7.1 on AIX 4.3.3.1, Python 1.5.2 and DB2.py 0.991

    create table X(Y decimal(5,2), Z integer)

    cursor.execute("insert into X(Y,Z) values ?, ?",('123.45','10'))

fails with SQL0408N, SQLSTATE=42821, type mismatch.

However,

    cursor.execute("insert into X(Y,X) values cast(? as
decimal(5,2)),cast(? as integer)",('123.45','10'))

succeeds.

The failing insert succeeds on Windows 2000 with mxODBC and ODBC
connected to the same database.  The Windows CLI/ODBC settings don't
seem to show any particular magic.

Steve Williams




More information about the Python-list mailing list