Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle db wrong result on subquery error

leocoppensJul 24 2009 — edited Jul 28 2009
Hi,

I work with Oracle databases up to 10g and I found an error and couldn’t find any documentation about it yet. Perhaps you can help me.

The error is quite easy to replicate. If you run the following query adapting the parameters you should get a result, the problem is that you should only get an error!

select * from user_tab_columns
where table_name in
(
select table_name from <TABLE_B>
);

Parameter: TABLE_B
Description: This should be an existing table of the schema which doesn’t have any table_name field.

As I said, the sub-query is wrong, so if you try to run it separately it fails. The problem is when you run both together because, if the link field has the same name, it returns all values of the table in the outer query.

Do you know if this is solved in 11g or in a specific patch of 10g?

Thanks in advance for your interest.

Best regards,
Leo (leocoppens@gmail.com)
This post has been answered by Sven W. on Jul 24 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 25 2009
Added on Jul 24 2009
6 comments
2,159 views