본문 바로가기
Tools/Eclipse & STS

[SPRING] java.sql.SQLSyntaxErrorException: ORA-01722: 수치가 부적합합니다

by 썸머워즈 2020. 3. 29.
반응형

- java.sql.SQLSyntaxErrorException : ORA-01722: 수치가 부적합합니다 -


오라클 공식 문서에서는 다음과 같이 설명한다.

(http://www.orafaq.com/wiki/ORA-01722)

 

An ORA-01722 ("invalid number") error occurs when an attempt is made to convert a character string into a number, and the string cannot be converted into a valid number. Valid numbers contain the digits '0' through '9', with possibly one decimal point, a sign (+ or -) at the beginning or end of the string, or an 'E' or 'e' (if it is a floating point number in scientific notation). All other characters are forbidden.


There are numerous situations where this conversion may occur. A numeric column may be the object of an INSERT or an UPDATE statement. Or, a numeric column may appear as part of a WHERE clause. It is even possible for this error to appear when there are no numeric columns appearing explicitly in the statement!

 

그냥 단순하게 해당 에러는

컬럼의 데이터 타입과 파라미터의 데이터 타입이 일치하지 않을경우

발생하는 에러이다.

 

대부분 실수때문에 발생하는거 같고

숫자 형식의 문자타입의 데이터일 경우 많이 발생한다.

 

컬럼은 문자타입인데 데이터는 숫자형으로만 받는경우 실수로 파라미터를 숫자로 넣어주기 때문이다.

 

사실 별거 아니기때문에

파라미터를 제대로 넣었는지 다시 확인해보면 되는 문제다.

반응형


댓글

TOP