Solved

Oracle 11g: sqlplus: though tables queried do exist, I get a 'table does not exist' when running query, why?

Posted on 2013-01-04
6
890 Views
Last Modified: 2013-01-04
Hello Experts,

Oracle 11g: via sqlplus: connected to db successfully.

I run: SELECT table_name FROM all_tables;
I get all tables available....

However, when I try to simple query such:
SELECT * FROM tableName;
I get: table does not exist

is this a permission issue?
Is there a way via the command line to know what permissions I have?

Regards,
0
Comment
Question by:epifanio67
  • 3
  • 2
6 Comments
 
LVL 32

Assisted Solution

by:awking00
awking00 earned 250 total points
ID: 38744174
If you are in schema "A" and select table_name from all_tables, you will get the table_names in other schemas to which you have been granted access. So, for example, your first query returned a table_name of tab1, but it belonged to schema "B", when you select * from tab1 you will get the table or view does not exist message. However, you should be able to get results by qualifying the table_name with the schema - select * from B.tab1.
0
 
LVL 22

Accepted Solution

by:
Steve Wales earned 250 total points
ID: 38744183
Selecting from all_tables will show you all tables that the user you are connected to has access to see - not necessarily all the tables that user owns.

Try this instead:

select owner, table_name from all_tables;

Is the table you are trying to select from owned by another user ?

Taking the output from that query, you can then do:

select * from owner.tableName;

Try that, let us know if that resolves the issue.
0
 
LVL 32

Expert Comment

by:awking00
ID: 38744331
Isn't that kind of what I said?
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 22

Expert Comment

by:Steve Wales
ID: 38744351
Look at the timestamps of the replies.  Less than 2 minutes between them.

I was typing mine while you were typing yours and you finished first.  When I started typing my answer there was no other reply there.
0
 

Author Closing Comment

by:epifanio67
ID: 38744358
thank you experts... I really appreciate your help
0
 
LVL 32

Expert Comment

by:awking00
ID: 38744676
And usually I'm the slow typist :-) No harm meant.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question