Re: [cx-oracle-users] More than one type returned for a single column
Brought to you by:
atuining
From: Anssi K. <aka...@gm...> - 2012-09-30 18:43:42
|
On Sun, Sep 30, 2012 at 8:11 PM, Jani Tiainen <re...@gm...> wrote: > That is exactly correct. You didn't provided initial precision nor scale > so it's adapting to whatever data is stored there. > > So when you save data Oracle stores data "as is". But I did some code > diving [1] to cx_oracle and it seems to do some analysis to returned data > and figures out return type. > > Yes, it is adapting to the data. The problem I have is that my expectation is that each SQL column has a single type. This is not reflected in the Python return types. Maybe my expectation isn't valid... DBAPI2 doesn't seem to require single type for single column, the only requirement I see is that cursor.description tells the type of the column, and one type available is NUMBER. How NUMBER is then represented in Python is left unspecified. - Anssi |