아래 쿼리 입니다. INSERT INTO T_CODE ( SYS_CD, --character IDX_CD, --character SUB_CD, --character SUB_NM, --character USER1, --character USER2, --character USER3, --character USER4, --character USER5,--character USER6, --character USER7, --character USER8, --character USER9, --character USER10, --character USER11, --character USER12, --character ORDER_SEQ, --interger USE_YN,--character WRITER, --character WRITE_DT) --date VALUES( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, to_number(coalesce(?,'999'),'9999999'), ?, ?, NOW())
Parameters: [2017, PERIOD, test, test, , , , , , , , , , , , , , Y, admin]
에러 발생
ERROR:[2018-02-01 16:27:19,081]hrintro.sys.system.mgrCode.service.impl.MgrCodeServiceImpl - SqlMapClient operation; SQL [];
--- The error occurred in hrintro/sqlmap/sys/system/MgrCode_SQL.xml.
--- The error occurred while applying a parameter map.
--- Check the MgrCodeDAO.insertMgrCodeDeatil-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: org.postgresql.util.PSQLException: 오류: 수치 자료형의 입력 구문에 오류가 있습니다: " "; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in hrintro/sqlmap/sys/system/MgrCode_SQL.xml.
--- The error occurred while applying a parameter map.
--- Check the MgrCodeDAO.insertMgrCodeDeatil-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: org.postgresql.util.PSQLException: 오류: 수치 자료형의 입력 구문에 오류가 있습니다: " "
과 같은 에러가 발생 합니다.
nvl 처리 되어 있던 부분을 coalesce로 변환 했고, to_number 로 한번 더 형 변환 했습니다.
어디가 잘못 된건가요???
답변 부탁 드립니다.
감사합니다.
http://www.postgresdba.com/bbs/board.php?bo_table=B10&wr_id=61
혹시 도움이 될런지
Case when ? Is null or ? = ‘’ then 으로 한번 바꿔보시면