I am newbie to oracle and I am trying to make a connection from python to an oracle table.
I can use Toad for oracle to access to the data of one table. I am running the same SQL command through python and I get the "DatabaseError: ORA-00942: table or view does not exist". I have search a lot and still do not know what the issue is:
I setup my connection:
import cx_Oracle
con = cx_Oracle.connect(<user>,<password>,<database name>)
print("Database version:", con.version)
Successful connection
I set my current schema
con.current_schema = 'schema_name'
and
cursor = con.cursor()
cursor.execute('select du.cfile_id from table_name du')
This throws an error of:
---------------------------------------------------------------------------
DatabaseError Traceback (most recent call last)
<ipython-input-195-f3f5aacf8431> in <module>()
----> 1 cursor.execute('select du.cfile_id from brwr_tau_to_du_log du')
DatabaseError: ORA-00942: table or view does not exist
Same query with same credential is working fine if I use "Toad for oracle". Note that I require to put "exec schema.PKG_DVS_ACCESS.get" before running my data extract on Toad. How should I include the command to my python code?
Thanks