[cx-oracle-users] cx_Oracle5.0.4 'NotSupportedErrors ' with numpy1.4.1
Brought to you by:
atuining
From: <Tob...@ce...> - 2011-01-12 16:23:59
|
Dear all, I am having a problem using numpy int's directly in cx_Oracle sql select statements The following code from an application no longer works with this configuration: python2.7 / cx_Oracle5.0.4 / numpy 1.4.1 import cx_Oracle import numpy db = cx_Oracle.connect('username/xxx@mydatabase') cursor = db.cursor() v = numpy.int32(8) #create a numpy32 bit sql = """select distinct myexperiment_id from experiment where myexperiment_id > :firstmsexpid """ #get me all experiments with ids above x (bound variable firstmsexpid ) cursor.execute(sql,dict(firstmsexpid=v)) Traceback (most recent call last): File "<stdin>", line 1, in <module> cx_Oracle.NotSupportedError: Variable_TypeByValue(): unhandled data type numpy.int32 cursor.execute(sql,dict(firstmsexpid=int(v))) #converts to python int, and will work and of course not using the bind variable works fine too. (Nothing works if using a numpy.int64) The application server has been recently upgraded to the above. Previously it ran without problem using the following configuration: python2.5.4 / cx_Oracle5.0.1 / numpy 1.3.0 Does anyone know if this is a cx_Oracle problem / underlying database or a numpy error? Thanks in advance for any help on this - I have spent much of the last 2 days scouring the web for clues: the only NotSupportedErrors I found had to do with Unicode problems, which I do not think this is. Toby -------------------------------------------- Toby Mathieson Bioinformatics Developer Tel: +49 (0) 6221 13757-411 Fax: +49 (0) 6221 13757-210 www.cellzome.com tob...@ce... ----------------------------------- Chairman of Board (Vorstandsvorsitzender): Mr. Timothy P.W. Edwards; Chairman of Supervisory Board (Aufsichtsratsvorsitzender): Dr. Charles Cohen Registered office: Heidelberg; Commercial register: Mannheim HRB 337016; Ust-IdNr:: DE 205 835 333 The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender immediately at the phone number stated above and destroy all copies of this message and any attachments. |