[cx-oracle-users] More than one type returned for a single column
Brought to you by:
atuining
From: Anssi K. <aka...@gm...> - 2012-09-29 23:32:58
|
It seems it is possible to have more than one type returned for a single column. Observe this test case: import cx_Oracle print cx_Oracle.version connection = cx_Oracle.connect('user/ passwd@' + cx_Oracle.makedsn('localhost', 1521, 'xe')) cur = connection.cursor() cur.execute("select case when dbms_random.random > 0.5 then 0.1 else 0 end from testtable") vals = [] vals.extend(row[0] for row in cur.fetchall()) print set([type(v) for v in vals]) The output is: 5.1.2 set([<type 'float'>, <type 'int'>]) To me this seems surprising - shouldn't a column have the same type across all rows in a single resultset? - Anssi |