This discussion is archived
6 Replies Latest reply: Sep 23, 2010 11:52 AM by 730306 RSS

cx_Oracle  issue

675949 Newbie
Currently Being Moderated
Hi All,

When I try to create a connection to Oracle 10g DB using cx_Oracle library I get the error message: cx_Oracle.DatabaseError: ORA-24315: illegal attribute type


The DB is installed on the same machine I am running the code. Is there anything I am doing wrong or any mistakes in the syntax?? Below is the code for your reference:

F:\MyWork>python
Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00)
MSC v.15
Type "help", "copyright", "credits" or "license" for more
import cx_Oracle>>> connection_string = "system/mypass@GLOBAL">>> connection = cx_Oracle.Connection(connection_string)Traceback (most recent call last):  File "<stdin>", line 1, in <module>cx_Oracle.DatabaseError: ORA-24315: illegal attribute typeThanks,Abdul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
  • 1. Re: cx_Oracle  issue
    390020 Newbie
    Currently Being Moderated
    Works ok in my environment (note I'm using python 2.5).

    -----
    $ ipython
    Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
    Type "copyright", "credits" or "license" for more information.

    In [1]: import cx_Oracle as ora

    In [2]: con_str = "i/me@mine"

    In [3]: con = ora.connect(con_str)

    In [4]: type(con)
    Out[4]: &lt;type 'cx_Oracle.Connection'&gt;

    In [5]: con = ora.Connection(con_str)

    In [6]: type(con)
    Out[6]: &lt;type 'cx_Oracle.Connection'&gt;
    -----
    Q: what is the output if you do:

    type(connection_string)


    ?

  • 2. Re: cx_Oracle  issue
    675949 Newbie
    Currently Being Moderated
    type(connection)
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    NameError: name 'connection' is not defined
  • 3. Re: cx_Oracle  issue
    390020 Newbie
    Currently Being Moderated
    I asked for connection_string, not connection. Also I'm assuming you're running it in the same python session you run the previous code you show us. Is that right?
  • 4. Re: cx_Oracle  issue
    675949 Newbie
    Currently Being Moderated
    Here is the code.....

    Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    import cx_Oracle
    connection_string = "system/mypass@GLOBAL"
    connection = cx_Oracle.Connection(connection_string)
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    cx_Oracle.DatabaseError: ORA-24315: illegal attribute type
    type(connection_string)
    <type 'str'>
    >>>




    I am doing all this under the same python session.
  • 5. Re: cx_Oracle  issue
    390020 Newbie
    Currently Being Moderated
    Since I was unable to find out what is happening, I forwarded your problem to the cx-oracle-users list. You can find an answer over there. Here's [the link|http://sourceforge.net/mailarchive/forum.php?forum_name=cx-oracle-users&max_rows=25&style=nested&viewmonth=200812&viewday=19].
  • 6. Re: cx_Oracle  issue
    730306 Newbie
    Currently Being Moderated
    I encountered this problem today, and there was no answer on the web.
    This is what I learned, although it is embarassing to admit. I had installed
    the Ora11g version of cx_Oracle, but the database is Ora10g. I deleted
    the Ora11g cx_Oracle files, installed the Ora10g version, and everything
    worked.
        --dang

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points