The following table describes the supported Oracle data types and their mapping to the Python data types. The type codes returned in the description
cursor attribute can be used in the addtypecast()
cursor method.
Oracle data type | Type code | Python data type |
---|---|---|
CHAR |
101 |
str |
VARCHAR2 |
102 |
str |
NCHAR |
103 |
str |
NVARCHAR2 |
104 |
str |
CLOB |
118 |
str |
NCLOB |
119 |
str |
CFILE |
121 |
str |
LONG |
122 |
str |
ROWID |
125 |
str |
UROWID |
126 |
str |
FLOAT |
107 |
float |
BINARY_FLOAT |
108 |
float |
BINARY_DOUBLE |
109 |
float |
NUMBER |
105 |
float |
INTEGER |
106 |
int |
DECIMAL |
153 |
float |
DATE |
111 |
datetime.date |
TIMESTAMP |
112 |
datetime.datetime |
TIMESTAMP WITH TIME ZONE |
113 |
datetime.datetime |
TIMESTAMP WITH LOCAL TIME ZONE |
114 |
datetime.datetime |
BLOB |
117 |
|
BFILE |
120 |
|
RAW |
123 |
|
LONG RAW |
124 |