'수치자료형 입력구문에 오류가 있습니다' 라는 에러 문의 0 4 4,220

by 네로 [PostgreSQL 노하우/팁/자료] [2018.02.01 16:47:33]


아래 쿼리 입니다.

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 로 한번 더 형 변환 했습니다.

어디가 잘못 된건가요???

답변 부탁 드립니다.

감사합니다.

 

 

by 우리집아찌 [2018.02.01 17:26:30]

postgresql은 모르지만

WRITE_DT가 character 형인가요?

date type이야 되지 않을까 추측해봅니다.


by 네로 [2018.02.01 17:43:07]

아..그건 제가 잘못 적은 겁니다.

date 형이 맞습니다.


by 삐르짱 [2018.02.01 19:33:25]

http://www.postgresdba.com/bbs/board.php?bo_table=B10&wr_id=61

혹시 도움이 될런지

Case when ? Is null or ? = ‘’ then 으로 한번 바꿔보시면 


by 네로 [2018.02.02 08:56:27]

감사합니다.

해결 했습니다.

댓글등록
SQL문을 포맷에 맞게(깔끔하게) 등록하려면 code() 버튼을 클릭하여 작성 하시면 됩니다.
로그인 사용자만 댓글을 작성 할 수 있습니다. 로그인, 회원가입