Sophie McCarrell
Sophie McCarrell

Reputation: 2871

"table or view does not exist" through oracle on PHP

I get the error "table or view does not exist" when i try to access any from a table. I'm using PDO with the OCI driver through PHP. I've been having a really tough time finding help with using oracle through PHP.

$dbh = new PDO("oci:dbname=listst", DB_USER, DB_PASS);

When I try select * from entriedLevels I get nothing back (even though entriedLevels exists and the user has select access).

When I try select OBJECT_NAME from user_objects where object_type = 'TABLE' I get nothing back.

When I try select TABLE_NAME from all_tables I can finally see all of the tables.

I apologize for my crummy writing, it's the end of a long day on a Friday... sorta brain dead.

Upvotes: 0

Views: 1977

Answers (1)

DCookie
DCookie

Reputation: 43533

Two alternatives come to mind:

  • Qualify the table name with the owner of the schema it's in:

select * from OWNER.entriedLevels

  • Create a public synonym for the table:

CREATE PUBLIC SYNONYM entriedLevels FOR OWNER.entriedLeveles;

Upvotes: 5

Related Questions