#4 Describe request

closed
nobody
None
5
2012-09-14
2006-10-22
No

Describe request like "DESCRIBE
SERVICENAME.TABLENAME" returns the DatabaseError ORA-
00900 "SQL instruction not valid"

I use Python 2.3.4 and cx_Oracle 4.2.1

Discussion

  • Logged In: YES
    user_id=619560

    This is not a bug. Only SQL*Plus understands the command
    "describe". It is not an actual SQL statement as you'll note
    if you go through the SQL reference manual for Oracle. You
    can get most of the information you are looking for by
    simply performing the following:

    cursor.execute("select * from servicename.tablename")
    print "Description:", cursor.description

    If you want to pretty print it like SQL*Plus does you'll
    have to go through the various entries in
    cursor.description. Hope that helps.

     


Anonymous


Cancel   Add attachments