반응형
Notice
Recent Posts
Recent Comments
IT 일기장
[MyBatis] selectKey를 활용한 auto increment 적용 본문
반응형
<insert id="insertSurveyQuestion" parameterType="egovMap">
/*insertSurveyQuestion*/
<selectKey resultType="int" keyProperty="svIdx" order="BEFORE">
SELECT NVL(MAX(sv_idx),0)+1 FROM t_surveyquestion
</selectKey>
INSERT INTO t_surveyquestion(sv_idx) VALUES(#{svIdx})
</insert>
오라클 시퀀스 생성해서 만드는 방법도 있는데 이 방법이 더 맘에 든다
반응형
'프로그래밍 언어 > XML' 카테고리의 다른 글
[MyBatis] separator UNION ALL (0) | 2021.12.20 |
---|---|
[XML] iBatis 자동 완성 기능 설정 (0) | 2021.12.10 |
[XML] egovframework 메모리 용량 조절 (0) | 2021.12.10 |
[MyBatis] association tag 활용 (0) | 2021.12.07 |
[MyBatis] HTML 제거 정규식 (0) | 2021.11.30 |
Comments