oracle+pyodbc ?

579 views
Skip to first unread message

Mehdi

unread,
May 20, 2015, 3:45:46 AM5/20/15
to sqlal...@googlegroups.com
Hi
Unfortunately i have to work with an old Oracle 9i database. I've managed to setup cx_oracle 4.4.1 with python2.7 for oracle 9i, but i need to work with python3 and cx_oracle doesn't support oracle 9i for python3.x. So i tried pyodbc and i can successfully connect to oracle 9i with it.
Now i want to know is there any way to use sqlalchemy with pyodbc in order to connect to oracle 9i ?
I've tried "oracle+pyodbc://me:pa...@127.0.0.1/sid" but i got this error:
sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:oracle.pyodbc

Thanks.

Mike Bayer

unread,
May 20, 2015, 10:39:41 AM5/20/15
to sqlal...@googlegroups.com


On 5/20/15 3:45 AM, Mehdi wrote:
Hi
Unfortunately i have to work with an old Oracle 9i database. I've managed to setup cx_oracle 4.4.1 with python2.7 for oracle 9i, but i need to work with python3 and cx_oracle doesn't support oracle 9i for python3.x.
it doesn't?  cx_oracle supports Py3K fully, do you have a link for where it fails to work on Oracle 9 ?   It's all just OCI and it builds against whatever oracle client libs you have.




So i tried pyodbc and i can successfully connect to oracle 9i with it.
Now i want to know is there any way to use sqlalchemy with pyodbc in order to connect to oracle 9i ?
I've tried "oracle+pyodbc://me:pa...@127.0.0.1/sid" but i got this error:
sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:oracle.pyodbc

we don't have a dialect for that right now.  You can make one, though it might have lots of issues as pyodbc is a difficult driver to work with in general and might not have support for many features of the Oracle database, typically this regards poor handling of datatypes (things like unicode, etc.).

I've attached the most rudimentary dialect possible for this.   If you were to "import oracle_pyodbc", you would then have available an engine URL like create_engine("oracle+pyodbc://user:pass@DSN").      I don't have an environment set up to interface ODBC to Oracle here and while this dialect should be able to make a successful connection, it might fail very quickly afterwards.  


Send me more detail about the Python3/cx_oracle/9i thing.




Thanks.
--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+...@googlegroups.com.
To post to this group, send email to sqlal...@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

oracle_pyodbc.py

Mehdi

unread,
May 20, 2015, 2:18:12 PM5/20/15
to sqlal...@googlegroups.com
This is what i get when i've tried to compile cx_oracle 4.4.1 with python 3.4 on XP machine with oracle 9i installed:

C:\temp\cx_Oracle-4.4.1>python setup.py build
running build
running build_ext
building 'cx_Oracle' extension
C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDE
BUG -IC:\oracle\ora90\oci\include -IC:\oracle\ora90\rdbms\demo -IC:\Python34\include -IC:\Pyt
hon34\include /Tccx_Oracle.c /Fobuild\temp.win32-3.4-9i\Release\cx_Oracle.obj -DBUILD_VERSION
=4.4.1
cx_Oracle.c
c:\temp\cx_oracle-4.4.1\Environment.c(35) : warning C4047: 'initializing' : 'Py_ssize_t' diff
ers in levels of indirection from 'char [18]'
c:\temp\cx_oracle-4.4.1\Environment.c(38) : warning C4113: 'destructor' differs in parameter
lists from 'printfunc'
c:\temp\cx_oracle-4.4.1\Environment.c(38) : warning C4133: 'initializing' : incompatible type
s - from 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\Environment.c(53) : warning C4047: 'initializing' : 'const char *' di
ffers in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\Error.c(41) : warning C4047: 'initializing' : 'Py_ssize_t' differs in
 levels of indirection from 'char [17]'
c:\temp\cx_oracle-4.4.1\Error.c(44) : warning C4113: 'destructor' differs in parameter lists
from 'printfunc'
c:\temp\cx_oracle-4.4.1\Error.c(44) : warning C4133: 'initializing' : incompatible types - fr
om 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\Error.c(55) : warning C4113: 'reprfunc' differs in parameter lists fr
om 'getattrofunc'
c:\temp\cx_oracle-4.4.1\Error.c(59) : warning C4047: 'initializing' : 'const char *' differs
in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\Error.c(68) : warning C4133: 'initializing' : incompatible types - fr
om 'PyMemberDef *' to 'PyGetSetDef *'
c:\temp\cx_oracle-4.4.1\Error.c(119) : error C2039: 'ob_type' : is not a member of 'udt_Error
'
        c:\temp\cx_oracle-4.4.1\Error.c(9) : see declaration of 'udt_Error'
c:\temp\cx_oracle-4.4.1\Error.c(130) : warning C4013: 'PyString_FromString' undefined; assumi
ng extern returning int
c:\temp\cx_oracle-4.4.1\Error.c(130) : warning C4047: 'return' : 'PyObject *' differs in leve
ls of indirection from 'int'
c:\temp\cx_oracle-4.4.1\Connection.c(145) : warning C4047: 'initializing' : 'Py_ssize_t' diff
ers in levels of indirection from 'char [21]'
c:\temp\cx_oracle-4.4.1\Connection.c(148) : warning C4113: 'destructor' differs in parameter
lists from 'printfunc'
c:\temp\cx_oracle-4.4.1\Connection.c(148) : warning C4133: 'initializing' : incompatible type
s - from 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\Connection.c(153) : warning C4047: 'initializing' : 'PyNumberMethods
*' differs in levels of indirection from 'reprfunc'
c:\temp\cx_oracle-4.4.1\Connection.c(163) : warning C4047: 'initializing' : 'const char *' di
ffers in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\Connection.c(172) : warning C4133: 'initializing' : incompatible type
s - from 'PyMethodDef *' to 'PyMemberDef *'
c:\temp\cx_oracle-4.4.1\Connection.c(173) : warning C4133: 'initializing' : incompatible type
s - from 'PyMemberDef *' to 'PyGetSetDef *'
c:\temp\cx_oracle-4.4.1\Connection.c(174) : warning C4133: 'initializing' : incompatible type
s - from 'PyGetSetDef *' to '_typeobject *'
c:\temp\cx_oracle-4.4.1\Connection.c(180) : warning C4113: 'initproc' differs in parameter li
sts from 'allocfunc'
c:\temp\cx_oracle-4.4.1\Connection.c(180) : warning C4047: 'initializing' : 'allocfunc' diffe
rs in levels of indirection from 'initproc'
c:\temp\cx_oracle-4.4.1\Connection.c(182) : warning C4113: 'newfunc' differs in parameter lis
ts from 'freefunc'
c:\temp\cx_oracle-4.4.1\Connection.c(182) : warning C4047: 'initializing' : 'freefunc' differ
s in levels of indirection from 'newfunc'
c:\temp\cx_oracle-4.4.1\Connection.c(398) : warning C4013: 'PyString_GET_SIZE' undefined; ass
uming extern returning int
c:\temp\cx_oracle-4.4.1\Connection.c(401) : warning C4013: 'PyString_AS_STRING' undefined; as
suming extern returning int
c:\temp\cx_oracle-4.4.1\Cursor.c(135) : warning C4047: 'initializing' : 'Py_ssize_t' differs
in levels of indirection from 'char [13]'
c:\temp\cx_oracle-4.4.1\Cursor.c(138) : warning C4113: 'destructor' differs in parameter list
s from 'printfunc'
c:\temp\cx_oracle-4.4.1\Cursor.c(138) : warning C4133: 'initializing' : incompatible types -
from 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\Cursor.c(143) : warning C4047: 'initializing' : 'PyNumberMethods *' d
iffers in levels of indirection from 'reprfunc'
c:\temp\cx_oracle-4.4.1\Cursor.c(153) : warning C4047: 'initializing' : 'const char *' differ
s in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\Cursor.c(161) : warning C4047: 'initializing' : 'PyMethodDef *' diffe
rs in levels of indirection from 'iternextfunc'
c:\temp\cx_oracle-4.4.1\Cursor.c(162) : warning C4133: 'initializing' : incompatible types -
from 'PyMethodDef *' to 'PyMemberDef *'
c:\temp\cx_oracle-4.4.1\Cursor.c(163) : warning C4133: 'initializing' : incompatible types -
from 'PyMemberDef *' to 'PyGetSetDef *'
c:\temp\cx_oracle-4.4.1\Cursor.c(164) : warning C4133: 'initializing' : incompatible types -
from 'PyGetSetDef *' to '_typeobject *'
c:\temp\cx_oracle-4.4.1\Cursor.c(170) : warning C4113: 'initproc' differs in parameter lists
from 'allocfunc'
c:\temp\cx_oracle-4.4.1\Cursor.c(170) : warning C4047: 'initializing' : 'allocfunc' differs i
n levels of indirection from 'initproc'
c:\temp\cx_oracle-4.4.1\Cursor.c(172) : warning C4113: 'PyObject *(__cdecl *)(PyTypeObject *,
PyObject *,PyObject *)' differs in parameter lists from 'freefunc'
c:\temp\cx_oracle-4.4.1\Cursor.c(172) : warning C4047: 'initializing' : 'freefunc' differs in
 levels of indirection from 'PyObject *(__cdecl *)(PyTypeObject *,PyObject *,PyObject *)'
c:\temp\cx_oracle-4.4.1\StringVar.c(31) : warning C4047: 'initializing' : 'Py_ssize_t' differ
s in levels of indirection from 'char [17]'
c:\temp\cx_oracle-4.4.1\StringVar.c(34) : warning C4113: 'destructor' differs in parameter li
sts from 'printfunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(34) : warning C4133: 'initializing' : incompatible types
- from 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(39) : warning C4047: 'initializing' : 'PyNumberMethods *'
 differs in levels of indirection from 'reprfunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(46) : warning C4113: 'getattrofunc' differs in parameter
lists from 'setattrofunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(46) : warning C4047: 'initializing' : 'setattrofunc' diff
ers in levels of indirection from 'getattrofunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(49) : warning C4047: 'initializing' : 'const char *' diff
ers in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\StringVar.c(57) : warning C4047: 'initializing' : 'Py_ssize_t' differ
s in levels of indirection from 'char [21]'
c:\temp\cx_oracle-4.4.1\StringVar.c(60) : warning C4113: 'destructor' differs in parameter li
sts from 'printfunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(60) : warning C4133: 'initializing' : incompatible types
- from 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(65) : warning C4047: 'initializing' : 'PyNumberMethods *'
 differs in levels of indirection from 'reprfunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(72) : warning C4113: 'getattrofunc' differs in parameter
lists from 'setattrofunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(72) : warning C4047: 'initializing' : 'setattrofunc' diff
ers in levels of indirection from 'getattrofunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(75) : warning C4047: 'initializing' : 'const char *' diff
ers in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\StringVar.c(83) : warning C4047: 'initializing' : 'Py_ssize_t' differ
s in levels of indirection from 'char [16]'
c:\temp\cx_oracle-4.4.1\StringVar.c(86) : warning C4113: 'destructor' differs in parameter li
sts from 'printfunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(86) : warning C4133: 'initializing' : incompatible types
- from 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(91) : warning C4047: 'initializing' : 'PyNumberMethods *'
 differs in levels of indirection from 'reprfunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(98) : warning C4113: 'getattrofunc' differs in parameter
lists from 'setattrofunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(98) : warning C4047: 'initializing' : 'setattrofunc' diff
ers in levels of indirection from 'getattrofunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(101) : warning C4047: 'initializing' : 'const char *' dif
fers in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\StringVar.c(109) : warning C4047: 'initializing' : 'Py_ssize_t' diffe
rs in levels of indirection from 'char [17]'
c:\temp\cx_oracle-4.4.1\StringVar.c(112) : warning C4113: 'destructor' differs in parameter l
ists from 'printfunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(112) : warning C4133: 'initializing' : incompatible types
 - from 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(117) : warning C4047: 'initializing' : 'PyNumberMethods *
' differs in levels of indirection from 'reprfunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(124) : warning C4113: 'getattrofunc' differs in parameter
 lists from 'setattrofunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(124) : warning C4047: 'initializing' : 'setattrofunc' dif
fers in levels of indirection from 'getattrofunc'
c:\temp\cx_oracle-4.4.1\StringVar.c(127) : warning C4047: 'initializing' : 'const char *' dif
fers in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\StringVar.c(282) : warning C4013: 'PyString_Check' undefined; assumin
g extern returning int
c:\temp\cx_oracle-4.4.1\StringVar.c(283) : warning C4047: '=' : 'const void *' differs in lev
els of indirection from 'int'
c:\temp\cx_oracle-4.4.1\StringVar.c(285) : warning C4013: 'PyBuffer_Check' undefined; assumin
g extern returning int
c:\temp\cx_oracle-4.4.1\StringVar.c(294) : warning C4018: '>' : signed/unsigned mismatch
c:\temp\cx_oracle-4.4.1\StringVar.c(295) : warning C4018: '>' : signed/unsigned mismatch
c:\temp\cx_oracle-4.4.1\StringVar.c(320) : warning C4013: 'PyString_FromStringAndSize' undefi
ned; assuming extern returning int
c:\temp\cx_oracle-4.4.1\StringVar.c(321) : warning C4047: 'return' : 'PyObject *' differs in
levels of indirection from 'int'
c:\temp\cx_oracle-4.4.1\LongVar.c(28) : warning C4047: 'initializing' : 'Py_ssize_t' differs
in levels of indirection from 'char [22]'
c:\temp\cx_oracle-4.4.1\LongVar.c(31) : warning C4113: 'destructor' differs in parameter list
s from 'printfunc'
c:\temp\cx_oracle-4.4.1\LongVar.c(31) : warning C4133: 'initializing' : incompatible types -
from 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\LongVar.c(36) : warning C4047: 'initializing' : 'PyNumberMethods *' d
iffers in levels of indirection from 'reprfunc'
c:\temp\cx_oracle-4.4.1\LongVar.c(43) : warning C4113: 'getattrofunc' differs in parameter li
sts from 'setattrofunc'
c:\temp\cx_oracle-4.4.1\LongVar.c(43) : warning C4047: 'initializing' : 'setattrofunc' differ
s in levels of indirection from 'getattrofunc'
c:\temp\cx_oracle-4.4.1\LongVar.c(46) : warning C4047: 'initializing' : 'const char *' differ
s in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\LongVar.c(54) : warning C4047: 'initializing' : 'Py_ssize_t' differs
in levels of indirection from 'char [22]'
c:\temp\cx_oracle-4.4.1\LongVar.c(57) : warning C4113: 'destructor' differs in parameter list
s from 'printfunc'
c:\temp\cx_oracle-4.4.1\LongVar.c(57) : warning C4133: 'initializing' : incompatible types -
from 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\LongVar.c(62) : warning C4047: 'initializing' : 'PyNumberMethods *' d
iffers in levels of indirection from 'reprfunc'
c:\temp\cx_oracle-4.4.1\LongVar.c(69) : warning C4113: 'getattrofunc' differs in parameter li
sts from 'setattrofunc'
c:\temp\cx_oracle-4.4.1\LongVar.c(69) : warning C4047: 'initializing' : 'setattrofunc' differ
s in levels of indirection from 'getattrofunc'
c:\temp\cx_oracle-4.4.1\LongVar.c(72) : warning C4047: 'initializing' : 'const char *' differ
s in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\LongVar.c(131) : warning C4047: '=' : 'const void *' differs in level
s of indirection from 'int'
c:\temp\cx_oracle-4.4.1\LongVar.c(169) : warning C4047: 'return' : 'PyObject *' differs in le
vels of indirection from 'int'
c:\temp\cx_oracle-4.4.1\NumberVar.c(47) : warning C4047: 'initializing' : 'Py_ssize_t' differ
s in levels of indirection from 'char [17]'
c:\temp\cx_oracle-4.4.1\NumberVar.c(50) : warning C4113: 'destructor' differs in parameter li
sts from 'printfunc'
c:\temp\cx_oracle-4.4.1\NumberVar.c(50) : warning C4133: 'initializing' : incompatible types
- from 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\NumberVar.c(55) : warning C4047: 'initializing' : 'PyNumberMethods *'
 differs in levels of indirection from 'reprfunc'
c:\temp\cx_oracle-4.4.1\NumberVar.c(62) : warning C4113: 'getattrofunc' differs in parameter
lists from 'setattrofunc'
c:\temp\cx_oracle-4.4.1\NumberVar.c(62) : warning C4047: 'initializing' : 'setattrofunc' diff
ers in levels of indirection from 'getattrofunc'
c:\temp\cx_oracle-4.4.1\NumberVar.c(65) : warning C4047: 'initializing' : 'const char *' diff
ers in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\NumberVar.c(283) : warning C4013: 'PyInt_AS_LONG' undefined; assuming
 extern returning int
c:\temp\cx_oracle-4.4.1\NumberVar.c(437) : warning C4013: 'PyInt_Check' undefined; assuming e
xtern returning int
c:\temp\cx_oracle-4.4.1\NumberVar.c(475) : warning C4013: 'PyInt_FromLong' undefined; assumin
g extern returning int
c:\temp\cx_oracle-4.4.1\NumberVar.c(475) : warning C4047: 'return' : 'PyObject *' differs in
levels of indirection from 'int'
c:\temp\cx_oracle-4.4.1\NumberVar.c(490) : warning C4047: 'return' : 'PyObject *' differs in
levels of indirection from 'int'
c:\temp\cx_oracle-4.4.1\NumberVar.c(491) : warning C4013: 'PyInt_FromString' undefined; assum
ing extern returning int
c:\temp\cx_oracle-4.4.1\NumberVar.c(491) : warning C4047: '=' : 'PyObject *' differs in level
s of indirection from 'int'
c:\temp\cx_oracle-4.4.1\DateTimeVar.c(28) : warning C4047: 'initializing' : 'Py_ssize_t' diff
ers in levels of indirection from 'char [19]'
c:\temp\cx_oracle-4.4.1\DateTimeVar.c(31) : warning C4113: 'destructor' differs in parameter
lists from 'printfunc'
c:\temp\cx_oracle-4.4.1\DateTimeVar.c(31) : warning C4133: 'initializing' : incompatible type
s - from 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\DateTimeVar.c(36) : warning C4047: 'initializing' : 'PyNumberMethods
*' differs in levels of indirection from 'reprfunc'
c:\temp\cx_oracle-4.4.1\DateTimeVar.c(43) : warning C4113: 'getattrofunc' differs in paramete
r lists from 'setattrofunc'
c:\temp\cx_oracle-4.4.1\DateTimeVar.c(43) : warning C4047: 'initializing' : 'setattrofunc' di
ffers in levels of indirection from 'getattrofunc'
c:\temp\cx_oracle-4.4.1\DateTimeVar.c(46) : warning C4047: 'initializing' : 'const char *' di
ffers in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\ExternalLobVar.c(46) : warning C4047: 'initializing' : 'Py_ssize_t' d
iffers in levels of indirection from 'char [14]'
c:\temp\cx_oracle-4.4.1\ExternalLobVar.c(49) : warning C4113: 'destructor' differs in paramet
er lists from 'printfunc'
c:\temp\cx_oracle-4.4.1\ExternalLobVar.c(49) : warning C4133: 'initializing' : incompatible t
ypes - from 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\ExternalLobVar.c(60) : warning C4113: 'reprfunc' differs in parameter
 lists from 'getattrofunc'
c:\temp\cx_oracle-4.4.1\ExternalLobVar.c(61) : warning C4113: 'getattrofunc' differs in param
eter lists from 'setattrofunc'
c:\temp\cx_oracle-4.4.1\ExternalLobVar.c(61) : warning C4047: 'initializing' : 'setattrofunc'
 differs in levels of indirection from 'getattrofunc'
c:\temp\cx_oracle-4.4.1\ExternalLobVar.c(65) : warning C4047: 'initializing' : 'const char *'
 differs in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\ExternalLobVar.c(151) : warning C4013: 'Py_FindMethod' undefined; ass
uming extern returning int
c:\temp\cx_oracle-4.4.1\ExternalLobVar.c(152) : warning C4047: 'return' : 'PyObject *' differ
s in levels of indirection from 'int'
c:\temp\cx_oracle-4.4.1\ExternalLobVar.c(272) : warning C4047: '=' : 'PyObject *' differs in
levels of indirection from 'int'
c:\temp\cx_oracle-4.4.1\ExternalLobVar.c(293) : warning C4047: 'return' : 'PyObject *' differ
s in levels of indirection from 'int'
c:\temp\cx_oracle-4.4.1\ExternalLobVar.c(421) : warning C4047: 'return' : 'PyObject *' differ
s in levels of indirection from 'int'
c:\temp\cx_oracle-4.4.1\ExternalLobVar.c(474) : error C2065: 'PyString_Type' : undeclared ide
ntifier
c:\temp\cx_oracle-4.4.1\ExternalLobVar.c(500) : warning C4047: 'return' : 'PyObject *' differ
s in levels of indirection from 'int'
c:\temp\cx_oracle-4.4.1\ExternalLobVar.c(562) : warning C4047: '=' : 'PyObject *' differs in
levels of indirection from 'int'
c:\temp\cx_oracle-4.4.1\ExternalLobVar.c(568) : warning C4047: '=' : 'PyObject *' differs in
levels of indirection from 'int'
c:\temp\cx_oracle-4.4.1\LobVar.c(33) : warning C4047: 'initializing' : 'Py_ssize_t' differs i
n levels of indirection from 'char [15]'
c:\temp\cx_oracle-4.4.1\LobVar.c(36) : warning C4113: 'destructor' differs in parameter lists
 from 'printfunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(36) : warning C4133: 'initializing' : incompatible types - f
rom 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(41) : warning C4047: 'initializing' : 'PyNumberMethods *' di
ffers in levels of indirection from 'reprfunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(48) : warning C4113: 'getattrofunc' differs in parameter lis
ts from 'setattrofunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(48) : warning C4047: 'initializing' : 'setattrofunc' differs
 in levels of indirection from 'getattrofunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(51) : warning C4047: 'initializing' : 'const char *' differs
 in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\LobVar.c(59) : warning C4047: 'initializing' : 'Py_ssize_t' differs i
n levels of indirection from 'char [16]'
c:\temp\cx_oracle-4.4.1\LobVar.c(62) : warning C4113: 'destructor' differs in parameter lists
 from 'printfunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(62) : warning C4133: 'initializing' : incompatible types - f
rom 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(67) : warning C4047: 'initializing' : 'PyNumberMethods *' di
ffers in levels of indirection from 'reprfunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(74) : warning C4113: 'getattrofunc' differs in parameter lis
ts from 'setattrofunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(74) : warning C4047: 'initializing' : 'setattrofunc' differs
 in levels of indirection from 'getattrofunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(77) : warning C4047: 'initializing' : 'const char *' differs
 in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\LobVar.c(85) : warning C4047: 'initializing' : 'Py_ssize_t' differs i
n levels of indirection from 'char [15]'
c:\temp\cx_oracle-4.4.1\LobVar.c(88) : warning C4113: 'destructor' differs in parameter lists
 from 'printfunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(88) : warning C4133: 'initializing' : incompatible types - f
rom 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(93) : warning C4047: 'initializing' : 'PyNumberMethods *' di
ffers in levels of indirection from 'reprfunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(100) : warning C4113: 'getattrofunc' differs in parameter li
sts from 'setattrofunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(100) : warning C4047: 'initializing' : 'setattrofunc' differ
s in levels of indirection from 'getattrofunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(103) : warning C4047: 'initializing' : 'const char *' differ
s in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\LobVar.c(111) : warning C4047: 'initializing' : 'Py_ssize_t' differs
in levels of indirection from 'char [16]'
c:\temp\cx_oracle-4.4.1\LobVar.c(114) : warning C4113: 'destructor' differs in parameter list
s from 'printfunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(114) : warning C4133: 'initializing' : incompatible types -
from 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(119) : warning C4047: 'initializing' : 'PyNumberMethods *' d
iffers in levels of indirection from 'reprfunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(126) : warning C4113: 'getattrofunc' differs in parameter li
sts from 'setattrofunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(126) : warning C4047: 'initializing' : 'setattrofunc' differ
s in levels of indirection from 'getattrofunc'
c:\temp\cx_oracle-4.4.1\LobVar.c(129) : warning C4047: 'initializing' : 'const char *' differ
s in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\CursorVar.c(32) : warning C4047: 'initializing' : 'Py_ssize_t' differ
s in levels of indirection from 'char [17]'
c:\temp\cx_oracle-4.4.1\CursorVar.c(35) : warning C4113: 'destructor' differs in parameter li
sts from 'printfunc'
c:\temp\cx_oracle-4.4.1\CursorVar.c(35) : warning C4133: 'initializing' : incompatible types
- from 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\CursorVar.c(40) : warning C4047: 'initializing' : 'PyNumberMethods *'
 differs in levels of indirection from 'reprfunc'
c:\temp\cx_oracle-4.4.1\CursorVar.c(47) : warning C4113: 'getattrofunc' differs in parameter
lists from 'setattrofunc'
c:\temp\cx_oracle-4.4.1\CursorVar.c(47) : warning C4047: 'initializing' : 'setattrofunc' diff
ers in levels of indirection from 'getattrofunc'
c:\temp\cx_oracle-4.4.1\CursorVar.c(50) : warning C4047: 'initializing' : 'const char *' diff
ers in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\ObjectType.c(68) : warning C4047: 'initializing' : 'Py_ssize_t' diffe
rs in levels of indirection from 'char [21]'
c:\temp\cx_oracle-4.4.1\ObjectType.c(71) : warning C4113: 'destructor' differs in parameter l
ists from 'printfunc'
c:\temp\cx_oracle-4.4.1\ObjectType.c(71) : warning C4133: 'initializing' : incompatible types
 - from 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\ObjectType.c(76) : warning C4047: 'initializing' : 'PyNumberMethods *
' differs in levels of indirection from 'reprfunc'
c:\temp\cx_oracle-4.4.1\ObjectType.c(86) : warning C4047: 'initializing' : 'const char *' dif
fers in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\ObjectType.c(95) : warning C4133: 'initializing' : incompatible types
 - from 'PyMemberDef *' to 'PyGetSetDef *'
c:\temp\cx_oracle-4.4.1\ObjectType.c(114) : warning C4047: 'initializing' : 'Py_ssize_t' diff
ers in levels of indirection from 'char [26]'
c:\temp\cx_oracle-4.4.1\ObjectType.c(117) : warning C4113: 'destructor' differs in parameter
lists from 'printfunc'
c:\temp\cx_oracle-4.4.1\ObjectType.c(117) : warning C4133: 'initializing' : incompatible type
s - from 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\ObjectType.c(122) : warning C4047: 'initializing' : 'PyNumberMethods
*' differs in levels of indirection from 'reprfunc'
c:\temp\cx_oracle-4.4.1\ObjectType.c(132) : warning C4047: 'initializing' : 'const char *' di
ffers in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\ObjectType.c(141) : warning C4133: 'initializing' : incompatible type
s - from 'PyMemberDef *' to 'PyGetSetDef *'
c:\temp\cx_oracle-4.4.1\ObjectType.c(300) : warning C4047: '=' : 'PyObject *' differs in leve
ls of indirection from 'int'
c:\temp\cx_oracle-4.4.1\ObjectType.c(310) : warning C4047: '=' : 'PyObject *' differs in leve
ls of indirection from 'int'
c:\temp\cx_oracle-4.4.1\ObjectType.c(408) : error C2039: 'ob_type' : is not a member of 'udt_
ObjectType'
        c:\temp\cx_oracle-4.4.1\ObjectType.c(9) : see declaration of 'udt_ObjectType'
c:\temp\cx_oracle-4.4.1\ObjectType.c(408) : warning C4047: 'function' : 'PyTypeObject *' diff
ers in levels of indirection from 'PyObject **'
c:\temp\cx_oracle-4.4.1\ObjectType.c(408) : warning C4024: 'GetModuleAndName' : different typ
es for formal and actual parameter 1
c:\temp\cx_oracle-4.4.1\ObjectType.c(408) : error C2198: 'GetModuleAndName' : too few argumen
ts for call
c:\temp\cx_oracle-4.4.1\ObjectType.c(410) : warning C4013: 'PyString_FromFormat' undefined; a
ssuming extern returning int
c:\temp\cx_oracle-4.4.1\ObjectType.c(412) : warning C4047: '=' : 'PyObject *' differs in leve
ls of indirection from 'int'
c:\temp\cx_oracle-4.4.1\ObjectType.c(438) : warning C4047: '=' : 'PyObject *' differs in leve
ls of indirection from 'int'
c:\temp\cx_oracle-4.4.1\ObjectType.c(509) : error C2039: 'ob_type' : is not a member of 'udt_
ObjectAttribute'
        c:\temp\cx_oracle-4.4.1\ObjectType.c(23) : see declaration of 'udt_ObjectAttribute'
c:\temp\cx_oracle-4.4.1\ObjectType.c(509) : warning C4047: 'function' : 'PyTypeObject *' diff
ers in levels of indirection from 'PyObject **'
c:\temp\cx_oracle-4.4.1\ObjectType.c(509) : warning C4024: 'GetModuleAndName' : different typ
es for formal and actual parameter 1
c:\temp\cx_oracle-4.4.1\ObjectType.c(509) : error C2198: 'GetModuleAndName' : too few argumen
ts for call
c:\temp\cx_oracle-4.4.1\ObjectType.c(513) : warning C4047: '=' : 'PyObject *' differs in leve
ls of indirection from 'int'
c:\temp\cx_oracle-4.4.1\ExternalObjectVar.c(35) : warning C4047: 'initializing' : 'Py_ssize_t
' differs in levels of indirection from 'char [17]'
c:\temp\cx_oracle-4.4.1\ExternalObjectVar.c(38) : warning C4113: 'destructor' differs in para
meter lists from 'printfunc'
c:\temp\cx_oracle-4.4.1\ExternalObjectVar.c(38) : warning C4133: 'initializing' : incompatibl
e types - from 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\ExternalObjectVar.c(51) : warning C4113: 'getattrofunc' differs in pa
rameter lists from 'setattrofunc'
c:\temp\cx_oracle-4.4.1\ExternalObjectVar.c(51) : warning C4047: 'initializing' : 'setattrofu
nc' differs in levels of indirection from 'getattrofunc'
c:\temp\cx_oracle-4.4.1\ExternalObjectVar.c(55) : warning C4047: 'initializing' : 'const char
 *' differs in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\ExternalObjectVar.c(208) : warning C4047: 'return' : 'PyObject *' dif
fers in levels of indirection from 'int'
c:\temp\cx_oracle-4.4.1\ExternalObjectVar.c(246) : warning C4047: '=' : 'char *' differs in l
evels of indirection from 'int'
c:\temp\cx_oracle-4.4.1\ExternalObjectVar.c(282) : warning C4047: '=' : 'char *' differs in l
evels of indirection from 'int'
c:\temp\cx_oracle-4.4.1\ObjectVar.c(38) : warning C4047: 'initializing' : 'Py_ssize_t' differ
s in levels of indirection from 'char [20]'
c:\temp\cx_oracle-4.4.1\ObjectVar.c(41) : warning C4113: 'destructor' differs in parameter li
sts from 'printfunc'
c:\temp\cx_oracle-4.4.1\ObjectVar.c(41) : warning C4133: 'initializing' : incompatible types
- from 'destructor' to 'printfunc'
c:\temp\cx_oracle-4.4.1\ObjectVar.c(46) : warning C4047: 'initializing' : 'PyNumberMethods *'
 differs in levels of indirection from 'reprfunc'
c:\temp\cx_oracle-4.4.1\ObjectVar.c(53) : warning C4113: 'getattrofunc' differs in parameter
lists from 'setattrofunc'
c:\temp\cx_oracle-4.4.1\ObjectVar.c(53) : warning C4047: 'initializing' : 'setattrofunc' diff
ers in levels of indirection from 'getattrofunc'
c:\temp\cx_oracle-4.4.1\ObjectVar.c(56) : warning C4047: 'initializing' : 'const char *' diff
ers in levels of indirection from 'unsigned long'
c:\temp\cx_oracle-4.4.1\ObjectVar.c(101) : warning C4018: '<' : signed/unsigned mismatch
c:\temp\cx_oracle-4.4.1\ObjectVar.c(118) : warning C4018: '<' : signed/unsigned mismatch
c:\temp\cx_oracle-4.4.1\ObjectVar.c(141) : warning C4047: '=' : 'char *' differs in levels of
 indirection from 'int'
c:\temp\cx_oracle-4.4.1\Variable.c(304) : error C2065: 'PyString_Type' : undeclared identifie
r
c:\temp\cx_oracle-4.4.1\Variable.c(312) : error C2065: 'PyBuffer_Type' : undeclared identifie
r
c:\temp\cx_oracle-4.4.1\Variable.c(333) : error C2065: 'PyInt_Type' : undeclared identifier
c:\temp\cx_oracle-4.4.1\Variable.c(1070) : error C2039: 'ob_type' : is not a member of 'udt_V
ariable'
        c:\temp\cx_oracle-4.4.1\Variable.c(28) : see declaration of 'udt_Variable'
c:\temp\cx_oracle-4.4.1\Variable.c(1070) : error C2039: 'ob_type' : is not a member of 'udt_V
ariable'
        c:\temp\cx_oracle-4.4.1\Variable.c(28) : see declaration of 'udt_Variable'
c:\temp\cx_oracle-4.4.1\Variable.c(1175) : warning C4047: '=' : 'char *' differs in levels of
 indirection from 'int'
c:\temp\cx_oracle-4.4.1\Variable.c(1177) : warning C4047: 'return' : 'PyObject *' differs in
levels of indirection from 'int'
c:\temp\cx_oracle-4.4.1\Variable.c(1179) : warning C4047: 'return' : 'PyObject *' differs in
levels of indirection from 'int'
c:\temp\cx_oracle-4.4.1\Variable.c(1182) : warning C4047: 'return' : 'PyObject *' differs in
levels of indirection from 'int'
c:\temp\cx_oracle-4.4.1\Variable.c(1206) : error C2039: 'ob_type' : is not a member of 'udt_V
ariable'
        c:\temp\cx_oracle-4.4.1\Variable.c(28) : see declaration of 'udt_Variable'
c:\temp\cx_oracle-4.4.1\Variable.c(1206) : warning C4047: 'function' : 'PyTypeObject *' diffe
rs in levels of indirection from 'PyObject **'
c:\temp\cx_oracle-4.4.1\Variable.c(1206) : warning C4024: 'GetModuleAndName' : different type
s for formal and actual parameter 1
c:\temp\cx_oracle-4.4.1\Variable.c(1206) : error C2198: 'GetModuleAndName' : too few argument
s for call
c:\temp\cx_oracle-4.4.1\Variable.c(1212) : warning C4047: '=' : 'PyObject *' differs in level
s of indirection from 'int'
c:\temp\cx_oracle-4.4.1\Cursor.c(324) : error C2039: 'ob_type' : is not a member of 'udt_Curs
or'
        c:\temp\cx_oracle-4.4.1\Cursor.c(9) : see declaration of 'udt_Cursor'
c:\temp\cx_oracle-4.4.1\Cursor.c(324) : warning C4047: 'function' : 'PyTypeObject *' differs
in levels of indirection from 'PyObject **'
c:\temp\cx_oracle-4.4.1\Cursor.c(324) : warning C4024: 'GetModuleAndName' : different types f
or formal and actual parameter 1
c:\temp\cx_oracle-4.4.1\Cursor.c(324) : error C2198: 'GetModuleAndName' : too few arguments f
or call
c:\temp\cx_oracle-4.4.1\Cursor.c(330) : warning C4047: '=' : 'PyObject *' differs in levels o
f indirection from 'int'
c:\temp\cx_oracle-4.4.1\Cursor.c(354) : error C2039: 'ob_type' : is not a member of 'udt_Curs
or'
        c:\temp\cx_oracle-4.4.1\Cursor.c(9) : see declaration of 'udt_Cursor'
c:\temp\cx_oracle-4.4.1\Cursor.c(432) : warning C4047: '=' : 'PyObject *' differs in levels o
f indirection from 'int'
c:\temp\cx_oracle-4.4.1\Cursor.c(700) : warning C4047: '=' : 'PyObject *' differs in levels o
f indirection from 'int'
c:\temp\cx_oracle-4.4.1\Cursor.c(703) : warning C4047: '=' : 'PyObject *' differs in levels o
f indirection from 'int'
c:\temp\cx_oracle-4.4.1\Cursor.c(704) : warning C4047: '=' : 'PyObject *' differs in levels o
f indirection from 'int'
c:\temp\cx_oracle-4.4.1\Cursor.c(705) : warning C4047: '=' : 'PyObject *' differs in levels o
f indirection from 'int'
c:\temp\cx_oracle-4.4.1\Cursor.c(706) : warning C4047: '=' : 'PyObject *' differs in levels o
f indirection from 'int'
c:\temp\cx_oracle-4.4.1\Cursor.c(707) : warning C4047: '=' : 'PyObject *' differs in levels o
f indirection from 'int'
c:\temp\cx_oracle-4.4.1\Cursor.c(1844) : warning C4047: 'return' : 'PyObject *' differs in le
vels of indirection from 'int'
c:\temp\cx_oracle-4.4.1\Cursor.c(1854) : warning C4047: 'return' : 'PyObject *' differs in le
vels of indirection from 'int'
c:\temp\cx_oracle-4.4.1\Connection.c(572) : warning C4047: '=' : 'PyObject *' differs in leve
ls of indirection from 'int'
c:\temp\cx_oracle-4.4.1\Connection.c(579) : warning C4047: '=' : 'PyObject *' differs in leve
ls of indirection from 'int'
c:\temp\cx_oracle-4.4.1\Connection.c(586) : warning C4047: '=' : 'PyObject *' differs in leve
ls of indirection from 'int'
c:\temp\cx_oracle-4.4.1\Connection.c(637) : error C2039: 'ob_type' : is not a member of 'udt_
Connection'
        c:\temp\cx_oracle-4.4.1\Connection.c(9) : see declaration of 'udt_Connection'
c:\temp\cx_oracle-4.4.1\Connection.c(650) : error C2039: 'ob_type' : is not a member of 'udt_
Connection'
        c:\temp\cx_oracle-4.4.1\Connection.c(9) : see declaration of 'udt_Connection'
c:\temp\cx_oracle-4.4.1\Connection.c(650) : warning C4047: 'function' : 'PyTypeObject *' diff
ers in levels of indirection from 'PyObject **'
c:\temp\cx_oracle-4.4.1\Connection.c(650) : warning C4024: 'GetModuleAndName' : different typ
es for formal and actual parameter 1
c:\temp\cx_oracle-4.4.1\Connection.c(650) : error C2198: 'GetModuleAndName' : too few argumen
ts for call
c:\temp\cx_oracle-4.4.1\Connection.c(657) : warning C4047: '=' : 'PyObject *' differs in leve
ls of indirection from 'int'
c:\temp\cx_oracle-4.4.1\Connection.c(661) : warning C4047: '=' : 'PyObject *' differs in leve
ls of indirection from 'int'
c:\temp\cx_oracle-4.4.1\Connection.c(663) : warning C4047: '=' : 'PyObject *' differs in leve
ls of indirection from 'int'
c:\temp\cx_oracle-4.4.1\Connection.c(866) : warning C4047: 'return' : 'PyObject *' differs in
 levels of indirection from 'int'
cx_Oracle.c(147) : warning C4047: 'return' : 'PyObject *' differs in levels of indirection fr
om 'int'
cx_Oracle.c(390) : warning C4013: 'Py_InitModule' undefined; assuming extern returning int
cx_Oracle.c(390) : warning C4047: '=' : 'PyObject *' differs in levels of indirection from 'i
nt'
cx_Oracle.c(396) : error C2065: 'PyExc_StandardError' : undeclared identifier
cx_Oracle.c(396) : warning C4047: 'function' : 'PyObject *' differs in levels of indirection
from 'int'
cx_Oracle.c(396) : warning C4024: 'SetException' : different types for formal and actual para
meter 4
cx_Oracle.c(399) : error C2065: 'PyExc_StandardError' : undeclared identifier
cx_Oracle.c(399) : warning C4047: 'function' : 'PyObject *' differs in levels of indirection
from 'int'
cx_Oracle.c(399) : warning C4024: 'SetException' : different types for formal and actual para
meter 4
cx_Oracle.c(427) : error C2065: 'PyBuffer_Type' : undeclared identifier
cx_Oracle.c(427) : error C2065: 'PyBuffer_Type' : undeclared identifier
error: command 'C:\\Program Files\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with
 exit status 2


So i'm not sure what should i do? downgrade python version to 3.3 or try to compile latest cx_oracle against oracle 9i?


On Wednesday, May 20, 2015 at 7:09:41 PM UTC+4:30, Michael Bayer wrote:

it doesn't?  cx_oracle supports Py3K fully, do you have a link for where it fails to work on Oracle 9 ?   It's all just OCI and it builds against whatever oracle client libs you have.

Mehdi

unread,
May 20, 2015, 2:24:14 PM5/20/15
to sqlal...@googlegroups.com
I just tried cx_oracle 5.1.3 with python 3.4:
C:\temp\cx_Oracle-5.1.3>python setup.py build

running build
running build_ext
building
'cx_Oracle' extension
creating build
creating build
\temp.win32-3.4-9i
creating build
\temp.win32-3.4-9i\Release

C
:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDE
BUG -IC:\oracle\ora90\oci\include -IC:\oracle\ora90\rdbms\demo -IC:\Python34\include -IC:\Pyt
hon34\include /
Tccx_Oracle.c /Fobuild\temp.win32-3.4-9i\Release\cx_Oracle.obj -DBUILD_VERSION
=5.1.3
cx_Oracle
.c
cx_Oracle
.c(27) : fatal error C1189: #error :  Unsupported version of OCI.

Mike Bayer

unread,
May 20, 2015, 2:35:39 PM5/20/15
to sqlal...@googlegroups.com


On 5/20/15 2:18 PM, Mehdi wrote:
This is what i get when i've tried to compile cx_oracle 4.4.1 with python 3.4 on XP machine with oracle 9i installed:

4.4.1 ?  That is an ancient version that does not support Python 3, and SQLAlchemy doesn't even have very good support for that old version.  You need to be on the 5.x series, install 5.1.3 which you can get at https://pypi.python.org/pypi/cx_Oracle



C:\temp\cx_Oracle-4.4.1>python setup.py build

So i'm not sure what should i do? downgrade python version to 3.3 or try to compile latest cx_oracle against oracle 9i?

What is significant about Python 3.3 vs. 3.4 ?






On Wednesday, May 20, 2015 at 7:09:41 PM UTC+4:30, Michael Bayer wrote:

it doesn't?  cx_oracle supports Py3K fully, do you have a link for where it fails to work on Oracle 9 ?   It's all just OCI and it builds against whatever oracle client libs you have.

Send me more detail about the Python3/cx_oracle/9i thing.
--

Mike Bayer

unread,
May 20, 2015, 2:37:41 PM5/20/15
to sqlal...@googlegroups.com
You should install newer OCI libraries to use for the client install, they should be compatible with an older server version.  Email the cx_oracle mailing list at http://lists.sourceforge.net/lists/listinfo/cx-oracle-users ; support information for cx_oracle can be found at https://bitbucket.org/anthony_tuininga/cx_oracle.


Reply all
Reply to author
Forward
0 new messages