登录 注册
当前位置:主页 > 资源下载 > SQL语言基础中的参照完整性错误

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

  • 更新:2024-07-07 11:41:56
  • 大小:5.26MB
  • 推荐:★★★★★
  • 来源:网友上传分享
  • 类别:Informix - 数据库
  • 格式:PPT

资源介绍

参照完整性错误 * 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.