• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 422
  • Last Modified:

SQL Update error


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.
  • 2
1 Solution
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:
mrongAuthor Commented:
How to tell if it is a table or a view? thanks
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now