dbaXchange.com


Database Resources
- RDBMS Server
-
Database Administration
-
Performance Tuning
- Backup and Recovery
-
Oracle Utilities

- SQL and PLSQL
-
Network Administration
-
Client Applications
-
Miscellaneous Stuff

Oracle's technology Sites

http://technet.oracle.com

http://metalink.oracle.com

http://asktom.oracle.com/

http://www.oramag.com


Search this site or the web


Site search Web search powered by FreeFind



 

Category     : Database Resources -> SQL and PLSQL

DB Version  : Oracle 9i

OS Details    : Sun Solaris9

 

What is a key-preserved table?

A table is key preserved if every key of the table can also be a key of the result of the join. In other words: when you join the key-preserved table, you won't get any row duplication for the key-preserved table: a key-preserved table has its keys preserved through a join.

For example, if you wrote an inline-update statement or a view that used multiple table joins and produced a result set where the key of one of the tables would uniquely identify the rows in the result set then the table that the key is from is a key preserved table.

Sometimes, when updates are done against views, oracle runs in to a situation where it cannot spot the key preserved attributes on the table that you want updates to happen and raises the ORA-1779 error: "cannot modify a column which maps to a non key-preserved table".

When such situation arise, there is a workaround for it and the workaround involves the usage of a hint. The bypass_ujvc hint which stands for bypass update join view check can be used to overcome the ORA-1779 error.

Usage example:

UPDATE /*+ BYPASS_UJVC */ (SELECT .......) SET ......