Home » SQL & PL/SQL » SQL & PL/SQL » ORA-01445: cannot select ROWID from a join view without a key-preserved table
ORA-01445: cannot select ROWID from a join view without a key-preserved table [message #334269] Wed, 16 July 2008 01:04 Go to next message
sweetkhaliq
Messages: 189
Registered: April 2006
Senior Member

Dear Members
I am using Oracle9i Enterprise Edition Release 9.2.0.1.0.

When I try to run this query I found this error
"ORA-01445: cannot select ROWID from a join view without a key-preserved table"
update store_mast sm1 
set code = (select code||to_char(rnum,'fm0000') from 
                   (select m.dscrip,s.code,row_number() over(partition by s.sub_cat_desc order by m.dscrip)rnum               
                    from item_sub_cat s,store_mast m
                    where s.sub_cat_desc = m.itmcat)x
where sm1.rowid = x.rowid)

I am using two tables 1-store_mast , 2-item_sub_cat in this query .

Please tell me what is problem.

Thanks

[Updated on: Wed, 16 July 2008 01:05]

Report message to a moderator

Re: ORA-01445: cannot select ROWID from a join view without a key-preserved table [message #334270 is a reply to message #334269] Wed, 16 July 2008 01:06 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Did you Google for that error-message?
What did you find, and what about it did you not understand?
Re: ORA-01445: cannot select ROWID from a join view without a key-preserved table [message #334271 is a reply to message #334269] Wed, 16 July 2008 01:09 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
AskTom Key-preserved table concept in join view

Regards
Michel
Re: ORA-01445: cannot select ROWID from a join view without a key-preserved table [message #334272 is a reply to message #334270] Wed, 16 July 2008 01:09 Go to previous messageGo to next message
sweetkhaliq
Messages: 189
Registered: April 2006
Senior Member

Yes i try to find out it from Google. In Google mostly problem is generated due using view in query. But i am using tables in my query. So i can not find up till know the solution of my problem.

Thanks for reply.
Re: ORA-01445: cannot select ROWID from a join view without a key-preserved table [message #334278 is a reply to message #334272] Wed, 16 July 2008 01:18 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You have to understand the root of the error from the article you found.
By the way, an inline view is a view.

I give you a clue: what is x.rowid?

Regards
Michel

[Updated on: Wed, 16 July 2008 01:19]

Report message to a moderator

Re: ORA-01445: cannot select ROWID from a join view without a key-preserved table [message #334379 is a reply to message #334278] Wed, 16 July 2008 06:01 Go to previous message
sweetkhaliq
Messages: 189
Registered: April 2006
Senior Member

Thanks Michel Cadot
For providing me link.
I solved my problem by joining primary key value in stead of rowid field.

Thanks and regards
Previous Topic: Error In quert
Next Topic: Mutating Trigger
Goto Forum:
  


Current Time: Sat Dec 03 01:23:32 CST 2016

Total time taken to generate the page: 0.04548 seconds