Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- CrudRepository update
- Transactions Propagation Option
- spring @mapper
- spring JPA DB Connection
- 자바버그수정
- Spring
- Vue
- JAVA Exception 종류
- vuecomponent
- NoArgsConstructor
- vueslot
- Spring JPA Specification
- repository annotation
- spring JPA DB multi Connection
- JPA DB 다중 Connection
- doker logs tail
- JPA DB Connection 다중
- JpaRepository update
- 도커 컨테이너 로그
- 도커 logs
- mapper annotationo
- spring DB Connection
- AllArgsConstructor
- docker 로그
- spring mapper
- Data Annotation
- spring repository
- @Builder @NoArgsConstructor
- spring mapper annotation
- 도커 로그 확인
Archives
- Today
- Total
개발을 잘하고 싶은 개발자
[DB] Oracle Procedure REF_CURSOR 사용 본문
프로시저 사용시 REF_CURSOR를 사용해서 반환되는 값을 넣어 출력한다.
사용법은 아래와 같다
CREATE OR REPLACE PROCEDURE select_Insa
(
pResult OUT SYS_REFCURSOR
, pcity IN insa.city%TYPE
)
IS
BEGIN
OPEN pResult FOR SELECT name, city FROM insa WHERE city=pcity;
END;
pResult OUT SYS_REFCURSOR 은
파라미터가 OUT이라 해당값을 불러온 놈에게 돌려준다 => list_Insa 프로시져의 실행문 select_Insa(vResult,pcity);
자바에서도 프로시져 호출시 아래와 같이 설정해준다.
procedureQuery.registerStoredProcedureParameter("o_cursor", City.class, ParameterMode.REF_CURSOR);
'Backend > DB' 카테고리의 다른 글
[DB] Spring Procedure 호출시 Entity로 받아오기 (0) | 2021.07.19 |
---|