Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COMPARE TWO TABLES

Status
Not open for further replies.

mkey

Programmer
Oct 3, 2001
288
CA
hI ALL,
I have created two tables in scott/tiger database.
table_a: id number, id_1 varchar2(10), id_2 varchar2(3)

table_b: id varchar2(10), id_1 varchar2(10), id_2 number

What I want to do is compare the table_a and table_b and see if the structure is the same. If not I want to identify the column and the data type where it is not the same.
In this cas id in table_a is number and table_b is varchar.

I have written a query something like this:
select table_name, column_name, data_type from dba_tab_columns where table_name = 'table_a'
minus select table_name, column_name, data_type from
where table_name = 'table_b'

This query is not giving me the result I need. Thank you in advance!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top