JPA, Querydsl JPA에서 오라클 함수, 프러시저 사용 예제
create or replace PROCEDURE p_getEnameByEmpno
(p_empno IN INTEGER, p_ename OUT VARCHAR2)
IS
BEGIN
SELECT ename
INTO p_ename
FROM emp
WHERE empno = p_empno;
END p_getEnameByEmpno;
create or replace FUNCTION p_getEmpByDeptno
(p_deptno IN INTEGER, emp_cursor OUT SYS_REFCURSOR )
RETURN SYS_REFCURSOR
IS
sql_string Varchar2(100);
BEGIN
sql_string := 'select empno, ename, deptno from Emp where deptno = :deptno' ;
Open emp_cursor FOR sql_string USING p_deptno;
return emp_cursor;
END p_getEmpByDeptno;
첨부파일 URL참조 - http://ojc.asia/bbs/board.php?bo_table=LecJpa&wr_id=268
댓글 없음:
댓글 쓰기