티스토리 뷰


org.postgresql.util.PSQLException: ERROR: column "disp_seq" is of type numeric but expression is of type character varying
  Hint: You will need to rewrite or cast the expression.
  Position: 297
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2284) ~[postgresql-9.4.1208.jar:9.4.1208]
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2003) ~[postgresql-9.4.1208.jar:9.4.1208]
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:200) ~[postgresql-9.4.1208.jar:9.4.1208]
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:424) ~[postgresql-9.4.1208.jar:9.4.1208]

 

 

* 개요

INSERT 시 #{dispSeq}가 NULL 인 경우 위 오류 발생

로그에 찍히는 INSERT 쿼리를 직접 실행시는 문제없이 실행됨.

 

* 원인

원인 파악 못 했으며

Integer 로 선언된 속성에 NULL 이 들어있을때 Numeric 컬럼으로 넘기면서 생기는 문제 정도로 파악

 

* 해결

<if> 구문을 이용하여 dispSeq=NULL 인 경우 INSERT 구문에서 제외하는 방식으로 해결

 

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함