# ;MODE=MySQL
총 1개의 포스트
[ Spring / MyBatis ] H2 연동해 테스트 수행 중, selectKey 태그 내에서 LAST_INSERT_ID() 구문 오류 발생 시
(부제 : H2 연동해 테스트 수행 시, SQL 호환 모드 설정 - 특정 벤더 기준으로 작성한 SQL 구문을 H2 에서도 실행 가능하도록) 에러 내용 : Resolved [org.springframework.jdbc.BadSqlGrammarException: Error selecting key or setting result to parameter object. Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Function "LASTINSERTID" not found; SQL statement: 원인 : 구문 오류 / H2 에서 구문 호환 H2 구문에는 MySQL 의 LASTINSERTID() 라는 함수가 없다. 따라서 H2 연동 후, SELECT LASTINSERTID() 질의 시 JdbcSQLSyntaxErrorException / BadSqlGrammarExcept
2021년 7월 31일
·
0개의 댓글·
0