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
902 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 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

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. …
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

739 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