SQL Update error

Hello,

I tried to update a field(non-null field) in oracle table but got the following error. Anyone know the reason and suggestions?

ORA-01779: cannot modify a column which maps to a non key-preserved table


Thanks in advance.
mrongAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
Are you using a join as part of the update or are you trying to update a view?

Check out that error code:
http://ora-01779.ora-code.com/
0
mrongAuthor Commented:
How to tell if it is a table or a view? thanks
0
slightwv (䄆 Netminder) Commented:
>>How to tell if it is a table or a view?

Easiest way:  Ask your DBA or developers.  If you don't know, should you really be updating it?

You can check the views: user_tables and user_views.

select table_name from user_tables where table_name='TABLE_FOR_UPDATE';

select view_name from user_views where view_name='TABLE_FOR_UPDATE';

Replace TABLE_FOR_UPDATE with the table name you are trying to update (make sure it is all upper case).

One of those selects should return a row.  Whichever one does, tells you if it is a table or a view.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.