Re: [cx-oracle-users] Inserting 'None' values
Brought to you by:
atuining
From: Jani T. <re...@gm...> - 2010-05-18 13:37:37
|
> Hi, > > I am trying to use a Python 'None' value as bind parameter for a > > geometry column in an insert statement, but this does not work: > >>> cursor.executemany('insert into spots values(:id, :height, :geom)', > >>> [{'id': 14, 'height': 2, 'geom': None}]) > > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > cx_Oracle.DatabaseError: ORA-00932: inconsistent datatypes: expected > MDSYS.SDO_GEOMETRY got CHAR > > >>> cursor.executemany('insert into spots values(:id, :height, NULL)', > >>> [{'id': 14, 'height': 2}]) > > I don't know what query is actually sent to the database, but it seems > as if 'None' is not converted to 'NULL'. And using 'None' as bind > parameter for the decimal column 'height' works. > > Is this a bug? Expected behaviour, see http://sourceforge.net/mailarchive/message.php?msg_name=49F050EC.30205%40gmail.com for further information. -- Jani Tiainen |