-
在SQL语言基础中,插入包含空值的行
资源介绍
插入带有空值的行
*
SQL> INSERT INTO dept (deptno, dname )
2 VALUES (60, 'MIS');
1 row created.
明确的方法: 指定 NULL 关键字.
SQL> INSERT INTO dept
2 VALUES (70, 'FINANCE', NULL);
1 row created.
省略的方法: 从列的链表忽略有空值的列.
*
Methods for Inserting Null Values
Be sure that the targeted column allows null values by verifying the Null? status from the SQL*Plus DESCRIBE command.
The Oracle Server automatically enforces all datatypes, data ranges, and data integrity constraints. Any column that is not listed explicitly obtains a null value in the new row.
Instructor Note
Common errors that can occur during user input:
Mandatory value missing for a NOT NULL column
Duplicate value violates uniqueness constraint
Foreign key constraint violated
CHECK constraint violated
Datatype mismatch
Value too wide to fit in column
- 上一篇: MMU一、二级映射表
- 下一篇: 使用替换变量检验插入值-SQL语言基础