<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
"http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="Product">
<insert id="insertProduct-Oracle" parameterClass="com.domain.Product">
INSERT INTO PRODUCT(PRD_ID, PRD_DESCRIPTION)
VALUES(STOCKIDSEQUENCE.NEXTVAL, #description#)
</insert>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
"http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="Product">
<insert id="insertProduct-Oracle" parameterClass="com.domain.Product">
<selectKey keyProperty="id" resultClass="int">
SELECT STOCKIDSEQUENCE.NEXTVAL AS ID FROM DUAL
</selectKey>
INSERT INTO PRODUCT(PRD_ID, PRD_DESCRIPTION)
VALUES(#id#, #description#)
</insert>
</sqlMap>
'Engineering WIKI > Database' 카테고리의 다른 글
저장 프로시저 (SP) 개념 뿌수기 (0) | 2022.04.05 |
---|---|
[Oracle] 시퀀스 정리 (0) | 2020.11.30 |
[Oracle] Vachar2 컬럼을 CLOB 간단 변경 (0) | 2020.11.25 |
[Mysql] 데이터 백업 및 복구 (0) | 2020.06.10 |
[ElasticeSearch] Delete Query prevent (0) | 2020.03.29 |
[Oracle]오라클 NVL 사용법 (0) | 2020.03.09 |
[MySQL] 날짜 조회 (0) | 2020.03.09 |
[MySql] Curdate() 와 Now()의 차이점 (0) | 2019.11.27 |