'Why do I get table or view does not exist with cx_oracle but not with sql developer?

Trying to build a python script to update a table in oracle. All grants have been given to the role, and the role has been granted to the schema I am using to perform CRUD operations.

When performing database transactions using cx_oracle SELECT, UPDATE, and DELETE work fine. But INSERT responds with 'table or view does not exist'.

sql = "INSERT INTO the_schema.the_table (col_1, col_2) VALUES ('val1', 'val2')"  
cur.execute(sql)

table or view does not exist

But in SQL Developer the insert works fine. Any Ideas? Is there something weird about cx_oracle when inserting?



Solution 1:[1]

So, turns out it was user error. In SQL Developer the user was logging in as schema owner and had grants to the sequence for the PK. in python, the user was logging in as the user schema and did not have grants for the sequence.

Problem solved by granting select on the sequence in the owner schema to the user schema.

Thanks for the Help All!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ashintrash