I have a query with UNION ALL statements.
SELECT * FROM HULL_A
UNION ALL
SELECT * FROM HULL_B;
It throws the error
ORA-01790 "expression must have same datatype as corresponding expression"
However, I checked that, and I think it is not the case. I used the following to check:
select db1.data_type, db2.data_type, db1.data_length, db2.data_length, db1.data_precision, db2.data_precision, db1.data_scale, db2.data_scale
from all_tab_columns db1
inner join all_tab_columns db2
on (db1.owner = db2.owner
and db1.column_name = db2.column_name)
where db1.table_name = 'HULL_A'
and db2.table_name = 'HULL_B'
and (
db1.data_type = db2.data_type
OR
db1.data_length = db2.data_length
)
I was able to link HULL_A to HULL_C and HULL_D using UNION ALL.
So why is ORACLE throwing the error? What other test could I perform in order to be able to perform the UNION ALL?
I am working on WINDOWS 10 ORACLE 11g

create tablestatements for both tables as formatted text - a_horse_with_no_name