You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

Retrieving Tables from different databases using database links with Escape Characters

1 reply [Last post]
ashok_star2004's picture
User offline. Last seen 28 weeks 3 days ago. Offline
Joined: 02/13/2009
Posts: 45

Hi!
I want to get tables which are present in one database and not present in other database using database links.The tables must start with PS_.
I wrote a query for this.but its not functioning.I want to get it using Escape characters.Can u help me out please..

SELECT C.TABLE_NAME FROM USER_TABLES C WHERE C.table_name like ‘PS\_%’ESCAPE’\’ AND C.TABLE_NAME NOT IN(SELECT A.TABLE_NAME FROM USER_TABLES A
WHERE A.table_name like ‘PS\_%’ESCAPE’\’
INTERSECT
SELECT B.TABLE_NAME FROM USER_TABLES@PJCRM B
WHERE B.table_name like ‘PS\_%’ESCAPE’\’)

Lepa's picture
User offline. Last seen 2 years 5 days ago. Offline
Joined: 06/23/2008
Posts: 591
Re: Retrieving Tables from different databases using ...

Quote:
I wrote a query for this.but its not functioning.I want to get it using Escape characters.

What is the error you are getting?

And why are you selecting from USER_TABLES and them having a NOT IN from the same table?!

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog