Re: [cx-oracle-users] Inserting 'None' values (Tobias Sauerwein)
Brought to you by:
atuining
From: Tamás G. <gt...@gt...> - 2010-05-27 12:40:45
|
What about an ugly Oracle workaround: create writable view over the "spots" table WITHOUT the column you're wanting to be NULL. > Message: 4 > Date: Tue, 18 May 2010 13:20:11 +0200 > From: Tobias Sauerwein <tob...@ca...> > Subject: [cx-oracle-users] Inserting 'None' values > To: cx-...@li... > Message-ID: > <AAN...@ma...> > Content-Type: text/plain; charset=ISO-8859-1 > > 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? > > Thanks, > Tobias > > > > > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > > End of cx-oracle-users Digest, Vol 47, Issue 4 > ********************************************** > |