0
votes

Im trying to import existing oracle tables in django. Installed cx_oracle and i did all the steps for django to communicate with my oracle db.

import cx_Oracle

con = cx_Oracle.connect("PYTHON","PYTHON", "METDBR")

cur = con.cursor()
cur.execute("select * from ICUSTOMER")
res = cur.fetchall()
for row in res:
    print(row)

works fine....

when im trying to inspect the table with the command

python manage.py inspectdb icustomer

i get Unable to inspect table 'icustomer' The error was: ORA-00942: table or view does not exist

2

2 Answers

0
votes

Usually, it is about letter case.

By default, Oracle stores table names in UPPERCASE. If you (or whoever created the table) used mixed case and enclosed table name into double quotes, you have to reference the table exactly like that: using the same letter case (as created), enclosed into double quotes.

Therefore, check exact table name.

0
votes

Check the USER that is configured in your default ENGINE, this is very probably not the user PYTHON.

You must than qualify the inspected table as PYTHON.ICUSTOMER

and grant the access on it the the engine user (while connected as PYTHON)

GRANT SELECT on PYTHON.ICUSTOMER to <engine user>;