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!

sinlge select query in diff schemas for same table(Indentical Structure)

973776Nov 12 2012 — edited Nov 13 2012
Scenario :

Table XYZ is created in Schema A
After an year, the old data from the previous year would be moved to different schema. However in the other schema the same table name would be used.

For eg

Schema A contains table XYZ with data of 2012 yr
Schema B contains table XYZ with data of 2011 yr
Table XYZ in both the schemas have identical structure.

So can we fire a single select query to read the data from both the tables in effective way.
Eg select * from XYZ where date range between 15-Oct-2011 to 15-Mar-2012.
However the data resides in 2 different schema altogether.


Creating an view is an option.
But my problem, there is ORM layer(either Hibernate or Eclipse Top Link) between the application and the database.
So the queries would be formed by the ORM layer and are not hand generated.
So i cannot use view.
So is there any option that would allow me to use single query on different schema's ?
This post has been answered by sb92075 on Nov 12 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 11 2012
Added on Nov 12 2012
8 comments
364 views