You are correct. That only works for Windows platforms and in this
case only because Oracle kept the API completely backwards compatible.
It is not, however, forward compatible so attempts to use the Oracle
9i DLL in place of the Oracle 8i DLL will not work. I wouldn't count
on this working in general as well -- this certainly wouldn't have
worked moving from Oracle 7 to Oracle 8.
That said, there is another method for determining what Oracle client
you have installed (and I wish Oracle would make it possible to
determine this in a much more friendly fashion but they don't). You
can (on Windows) look for oraclient8.dll or oraclient9.dll or
oraclient10.dll and on Unix platforms for libclient8.a or libclient9.a
or libclient10.a and take the appropriate action. I have done this for
one of my own projects (cx_OracleDBATools) and it works quite well.
You do have to have the cx_Oracle extension renamed to something like
cx_Oracle_8i.pyd, cx_Oracle 9i.pyd and cx_Oracle10g.pyd and then use
"import cx_Oracle_8i as cx_Oracle" or something like that. Make sense?
On 4/15/05, ama...@ub...
<ama...@ub...> wrote:
>=20
> Hello,
>=20
> > Hoping for a bit of advice and apologies up front if this is a dumb
> > question (it may be).
> >
> > Have an executable Python app built with py2exe that uses cx_Oracle
> > (currently one of the binary versions built for Oracle 8.x). Now in a
> > situation where I need to support both the Oracle 8.x client and the
> > 9.x client (some users have 8.x, others have 9.x).
> >
> > Is there a way I can do this at runtime i.e. detect the Oracle client
> > version and load the correct cx_Oracle version? Guess that implies
> > having multiple versions of the Oracle client and cx_Oracle installed
> > on the PC where I build the app with py2exe. What I'm hoping to
> > provide a single executable that will work for all Oracle client
> > versions.
>=20
> The cx_Oracle built for Oracle 8 should work as well on a 9.x client.
> There is nothing to do except to ensure that OCI.DLL can be located
> through the PATH environment variable.
>=20
> I guess this is only true for Windows platforms...
>=20
> --
> Amaury Forgeot d'Arc
> Ubix Development
> www.ubitrade.com
>=20
>=20
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
> _______________________________________________
> cx-oracle-users mailing list
> cx-...@li...
> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
>
|