PDA

View Full Version : Oracle a query the error ORA-01445


madana
Oct 1, 2009, 01:39 AM
ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved table

I am running a query on Oracle 10G database.
Why this error occurs and what is a key-preserved table.
If I run the query without the view it runs.
When I join the view to the query I get the error.
Can you help resolving this.
Thanks and Regards
Madana

fozzyman
Nov 18, 2009, 07:13 AM
I had the same problem.
In my case I solved by limiting the number of columns in the join:
ex.

select * from tableA a join tableB b on (a.column = b.column)

by

select * from tableA a join (select column from tableB) b on (a.column = b.column)