Home » SQL & PL/SQL » SQL & PL/SQL » Comparsion between column names of 2 tables (Oracle)
Comparsion between column names of 2 tables [message #300701] Sun, 17 February 2008 21:59 Go to next message
nandora
Messages: 2
Registered: January 2008
Junior Member
Hi
I need to comapare table names of R11.5.7 version and R12 version.And if the table names are same, then I need to compare their column names whether they are same or not or if any new column has been added.

Please tell me if their is any automated mathod to do this.

Thanks in advance

Re: Comparsion between column names of 2 tables [message #300704 is a reply to message #300701] Sun, 17 February 2008 22:11 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
select table_name, column_name from dba_tab_columns@v12 where owner = 'schema_name'
minus
select table_name, column_name from dba_tab_columns@v11 where owner = 'schema_name'
Re: Comparsion between column names of 2 tables [message #300712 is a reply to message #300704] Sun, 17 February 2008 22:43 Go to previous messageGo to next message
nandora
Messages: 2
Registered: January 2008
Junior Member
Please clarify what to write at the place for @v11 and @v12
Re: Comparsion between column names of 2 tables [message #300833 is a reply to message #300712] Mon, 18 February 2008 03:47 Go to previous message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What are "R11.5.7" and "R12"? It *sounds* like Oracle Apps. versions. I don't know much about these products, but - as you are mentioning "tables" and "columns", they must be in a schema.

As there are two different versions, is it possible that each of them contains its own schema? Are they in the same database? If so, you might grant SELECT privilege from one to another and qualify table name (actually, a view name) with owner, such as
SELECT table_name, column_name FROM v12.dba_tab_columns ...
If there are different databases, you'll need to create a database link and query might look as Anacedent showed you:
SELECT table_name, column_nam FROM dba_tab_columns@v12 ...

So, what "@v11" and "@v12" are, depends mostly on you.
Previous Topic: ORA-00920: invalid relational operator
Next Topic: Dynamic Fetching records when Table is created dynamically
Goto Forum:
  


Current Time: Sun Dec 04 00:39:03 CST 2016

Total time taken to generate the page: 0.26372 seconds