CREATE OR REPLACE PROCEDURE KM_GET_KNOWLEDGE_LIST_PAGE
(p_pageid NUMBER, p_baseid NUMBER, p_cid varchar2, p_msg OUT varchar2)
Is
/****************************************************************************/
/*
/* NAME : KM_GET_KNOWLEDGE_LIST_PAGE :
/*
/* 날 짜 : 07-03-27 - 수정중 -
/* 작성자 : 류지훈
/* 내 용 : 자신이 쓴 지식 가져오기 인듯..
/* 참 고 : board.xml <GET_KNOWLEDGE_LIST_PAGE>
/* 예 제 : KM_GET_KNOWLEDGE_LIST_PAGE(15,10,'1160455692057',v_msg);
/*
/*****************************************************************************/
v_sql_str VARCHAR2(4000);
--v_rtn IKEP_CR_BD_LIST%ROWTYPE; alias 매치가 안됨;
v_seq NUMBER;
v_bseq NUMBER;
v_cid VARCHAR2(50);
v_ref NUMBER;
v_step NUMBER;
v_lev NUMBER;
v_userid VARCHAR2(20);
v_title VARCHAR2(500);
v_rdate VARCHAR2(100);
v_mdate VARCHAR2(100);
v_hit NUMBER;
v_alias VARCHAR2(40);
v_body VARCHAR2(2000);
v_expired_date VARCHAR2(100);
CURSOR cr_kl IS
SELECT SEQ, BSEQ, CID, REF, STEP, LEV, RUSERID as userid, TITLE, RDATE, MDATE as lmdate,
HIT, rusername as alias, summary as body, EXPIREDATE as expired_date
FROM IKEP_CR_BD_LIST
WHERE CID = p_cid
AND STATUS = 'Y'
AND SEQ NOT IN (SELECT SEQ
FROM IKEP_CR_BD_LIST
WHERE CID = p_cid
AND STATUS = 'Y'
AND ROWNUM < p_baseid)
AND ROWNUM < p_pageid
ORDER BY RDATE DESC, STEP ASC;
BEGIN
DBMS_OUTPUT.ENABLE;
OPEN cr_kl;
LOOP
DBMS_OUTPUT.PUT_LINE('LOOP');
FETCH cr_kl INTO v_seq, v_bseq, v_cid, v_ref, v_step, v_lev, v_userid, v_title, v_rdate,
v_mdate, v_hit, v_alias, v_body, v_expired_date;
EXIT WHEN cr_kl%NOTFOUND;
END LOOP;
CLOSE cr_kl;
p_msg :='처리완료';
EXCEPTION
WHEN NO_DATA_FOUND THEN
p_msg :='NO DATA FOUND';
DBMS_OUTPUT.PUT_LINE(p_msg);
RETURN;
END;