?
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
Medium Priority
?
908 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 32

Assisted Solution

by:awking00
awking00 earned 1000 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 1000 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
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses

752 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