본문 바로가기
Study/Oracle

[Oracle-Error] ORA-00947:”not enough values”

by byeolsub 2023. 5. 2.
  • ORA-00947: 값의 수가 충분하지 않습니다.
This can happen because in 2 scenarios:
1. When the SQL statement requires 2 sets of values which are equal in number but the second set containing items lesser than the first one. This typically happens in the WHERE/HAVING clause.
2. The INSERT statement not containing enough number of values. The number of values being inserted must be equal to the number of columns existing in the table (applies when columns names are not mentioned explicitly).

- 삽입하려는 값들과 테이블의 컬럼 수가 일치하지 않아서 발생.

  1. INSERT INTO 테이블명(컬럼1,컬럼2) VALUES(값1,값2)
  2. INSERT INTO 테이블명 VALUES(테이블의 컬럼의 수에 맞게 데이터 삽입) </aside>