selectKey 활용
|
<insert id="insertFTETemplate" parameterType="kr.co.crscube.ctms.model.manage.FTETemplate" useGeneratedKeys="true" keyProperty="templateKey">
<selectKey keyProperty="templateKey" resultType="int" order="BEFORE">
SELECT SEQ_SPO_TMPL_KEY.NEXTVAL FROM DUAL
</selectKey>
INSERT
INTO SPO_FTE_TMPL
VALUES (#{templateKey}, #{sponsorKey}, #{templateName}, #{description}, #{reason}, 'N', SYSDATE, #{userKey})
</insert>
|
parmeterType을 지정해 주지 않으면 계속 1 반환
parmeterType의 keyProperty 변수에 값 받는다.
'개발 > 데이터베이스' 카테고리의 다른 글
| [Oracle] 시퀀스 캐시 (0) | 2022.12.27 |
|---|---|
| [Oracle] 계층형 쿼리 (3) | 2022.12.27 |
| [Oracle] Connection Pool Error (3) | 2022.12.27 |
| [Oracle] ORA-01722 문자를 숫자로 반환하는데 오류입니다. (2) | 2022.12.27 |