맞춤검색


1.프로시저 생성. 
	CREATE OR REPLACE package types as 
		type cursorType is ref cursor;
	end; 

	CREATE OR REPLACE procedure SP_CURSOR_TEST(ret_cursor out types.cursorType, p_num out number, p_text out varchar2 ) 
	is
	begin
		select 3 , 'test3' into p_num, p_text from dual;

		open ret_cursor for 
			SELECT 
			*
			FROM COM_SAMPLE;
	end;



2.sql xml 적용예시.
Q_com_sample.xml 파일참조.
sql id="list_cursor_proc"
sql_id="list_cursor_proc_out_test"
			
				{ call SP_CURSOR_TEST(@:CURSOR, @:sp_test_num, '@:sp_test_text') }
			
			
				SELECT @@sp_test_num, @@sp_test_text from dual
			



3. CURSOR 타입 프로시저 호출방법.
/caf/samples/com_sample_complex.jsp 파일참조.


4. 프로시저 타입사용시 변수구분 설명.
IN/OUT TYPE
@@변수명 - IN -
@:변수명 - OUT NUMBER
'@:변수명' - OUT VARCHAR2
@:CURSOR - OUT CURSOR

CURSOR 타입이 아닌 OUT 의 경우에는 dbmanager.getGlobalParams()   메소드를 통해 해당 변수명에 해당하는 변수값을 가져올 수 있음.
sql type="uid" 형식과 동일하게 작동함.

5. 제약사항
select 쿼리의 경우 . item 으로 proc 를 추가할 수 없음. proc 인 경우에는 별도 sql 로      위의 3번과 같이 구현.

Tracked by ClickAider