参照完整性错误-SQL语言基础

时间:2021-04-25 19:38:26
【文件属性】:
文件名称:参照完整性错误-SQL语言基础
文件大小:5.26MB
文件格式:PPT
更新时间:2021-04-25 19:38:26
SQL 基础 参照完整性错误 * UPDATE emp * ERROR at line 1: ORA-02291: integrity constraint (USR.EMP_DEPTNO_FK) violated - parent key not found SQL> UPDATE emp 2 SET deptno = 55 3 WHERE deptno = 10; 不存在第55号部门 * Integrity Constraint Error If you attempt to update a record with a value that is tied to an integrity constraint, you will experience an error. In the example on the slide, department number 55 does not exist in the parent table, DEPT, and so you receive the parent key violation ORA-02291. Note: Integrity constraints ensure that the data adheres to a predefined set of rules. A subsequent lesson will cover integrity constraints in greater depth. Instructor Note Explain integrity constraints and review the concept of primary key and foreign key.

网友评论