Oracle/SQL Fundamentals I
10일차 # 8-7: Insert 수행시 발생하기 쉬운 오류들
Bohemian life
2012. 4. 17. 21:20
1) NOT NULL 제약조건임에도 값을 생략하는 경우
drop table t2 purge;
create table t2 (no number(3), name varchar2(20) not null);
desc t2
insert into t2 values (10, 'JAMES');
insert into t2 values (20, null);
insert into t2 values (20, null)
*
ERROR at line 1:
ORA-01400: cannot insert NULL into ("JAVA30"."T2"."NAME")
insert into t2 (no) values (20);
insert into t2 (no) values (20)
*
ERROR at line 1:
ORA-01400: cannot insert NULL into ("JAVA30"."T2"."NAME")
2) UNIQUE 제약조건인데 중복되는 값을 입력하는 경우
3) FOREIGN KEY 제약조건 위배
4) CHECK 제약조건 위배
5) 데이터 타입 일치하지 않을 때
6) 컬럼에 들어가는 데이터가 너무 클 때