I cannot get variable binding to work with Oracle (cx_oracle) in 1.2 RC1 at all.
Every single attempt to do an insert ends with an Oracle error.
E.g.
Running this in a unit testCode:def insert_unit(unit_id,unit_name): pk = central.query_for_int("SELECT S_UNIT.NEXTVAL FROM DUAL") central.update("INSERT INTO T_UNIT (F_UNIT_PK, F_UNIT_ID, F_NAME) VALUES (?, ?, ?)",(pk,unit_id,unit_name)) return pk
results in :Code:def testUnitInsert(self): insert_unit(100, "Unit 100")
I get this across all tables I've tried.Code:====================================================================== ERROR: testUnitInsert (msdp.test.test.Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/jacekf/src/msdp-server/msdp-server/lib/common-test/src/main/python/msdp/test/test.py", line 19, in testUnitInsert insert_unit(100, "Unit 100") File "/home/jacekf/src/msdp-server/msdp-server/lib/common-test/src/main/python/msdp/test/central_facade.py", line 13, in insert_unit central.update("INSERT INTO T_UNIT (F_UNIT_PK, F_UNIT_ID, F_NAME) VALUES (?, ?, ?)",(pk,unit_id,unit_name)) File "/usr/local/lib/python2.6/dist-packages/springpython-1.2.0.RC1-py2.6.egg/springpython/database/core.py", line 182, in update return self.execute(sql_statement, args) File "/usr/local/lib/python2.6/dist-packages/springpython-1.2.0.RC1-py2.6.egg/springpython/database/core.py", line 80, in execute raise DataAccessException(error) DataAccessException: ORA-01036: illegal variable name/number


Reply With Quote