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!

Need help with writing a query with dynamic FROM clause

rogers7942Aug 11 2011 — edited Aug 11 2011
Hi Folks,

I need help with an query that should generate the "FROM" clause dynamically.

My main query is as follows
select DT_SKEY, count(*)
from *???*
where DT_SKEY between 20110601 and 20110719
group by DT_SKEY
having count(*) = 0
order by 1; 
The "from" clause of the above query should be generated as below
select 'Schema_Name'||'.'||TABLE_NAME
from dba_tables
where OWNER = 'Schema_Name'
Simply sticking the later query in the first query does not work.

Any pointers will be appreciated.

Thanks

rogers42
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 8 2011
Added on Aug 11 2011
6 comments
324 views