On Sunday 30 September 2012, Anssi Kääriäinen wrote:
> 
>     cur.execute("select case when dbms_random.random > 0.5 then 0.1
> else 0 end from testtable")
> 
> Guess what is the type of the column? It is both Decimal and int,
> alternating based on the random result.
> 
> This seems like surprising behaviour to me. The problem is in
> cx_Oracle, not Django code. In raw cx_Oracle queries you get ints and
> floats mixed.

I tried this query in sqlplus, and the response looks like mixed ints and 
floats there too. I don't know a way to get a value's datatype inside Oracle, 
so it's hard to be sure, but it could be that cx_Oracle is only reflecting 
Oracle with this.

> I don't believe it is OK to return different types for
> the same column in one resultset. I will report to cx_Oracle mailing
> list and see if they have anything to say about this.

I'm curious as well.

Shai.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to