Home » SQL & PL/SQL » SQL & PL/SQL » Select command betwen two differente owners
Select command betwen two differente owners [message #435903] Fri, 18 December 2009 14:17 Go to next message
gsmdf
Messages: 1
Registered: December 2009
Junior Member
Guys,

I have the following problem:

My database has tables of owner X and auditory tables of owner Y.
1) I need the select command that return the name of the tables that owner X has and owner Y doesn´t have.
2) I need the select command that return the columns that are in the table of owner X that are not in the correspond table of owner Y.

The pattern of my database is that for every new table created for owner X it must be created too a auditoy table with the same name for owner Y with fields like old_originalField. There are triggers that after delete/insert/update feeds this auditory table of owner Y.

Thanks in advance.
Re: Select command betwen two differente owners [message #435904 is a reply to message #435903] Fri, 18 December 2009 14:29 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
>1) I need the select command that return the name of the tables that owner X has and owner Y doesn´t have.

SELECT TABLE_NAME
WHERE OWNER = 'X'
MINUS
SELECT TABLE_NAME
WHERE OWNER = 'Y'

>2) I need the select command that return the columns that are in the table of owner X that are not in the correspond table of owner Y.

similar to above but on COLUMN_NAME

You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
Go to the URL above click the link "Posting Guidelines"
Go to the section labeled "Practice" & do as directed.
Re: Select command betwen two differente owners [message #435910 is a reply to message #435903] Fri, 18 December 2009 17:32 Go to previous message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
user_tables, user_tab_columns
all_tables, all_tab_columns
dba_tables, dba_tab_columns

Good luck, Kevin
Previous Topic: XML Parsing In Oracle
Next Topic: Stored procedure (merged 3)
Goto Forum:
  


Current Time: Sun Dec 04 10:32:14 CST 2016

Total time taken to generate the page: 0.13205 seconds