CREATE OR REPLACE PROCEDURE KPX_INTRANET.SUMMARY_DATA
(
V_SUM_GUBUN IN CHAR
, V_SUM_REG_NO IN VARCHAR2
, V_CHARGE_REG_NO IN VARCHAR2
, V_REPORT_DATE IN VARCHAR2
, V_DEPT_CD IN VARCHAR2
)
IS
V_SUM_DATE KPX_INTRANET.SCEP_SUMMARY_APP.SUM_DATE%TYPE;
V_UP_DEPT_CD KPX_INTRANET.SCEP_SUMMARY_APP.UP_DEPT_CD%TYPE;
V_POINT_GUBUN KPX_INTRANET.SCEP_SUMMARY_APP.POINT_GUBUN%TYPE;
V_FILE_MNG_CODE KPX_INTRANET.SCEP_SUMMARY_APP.FILE_MNG_CODE%TYPE;
V_SUM_CONTENT KPX_INTRANET.SCEP_SUMMARY_APP.SUM_CONTENT%TYPE;
V_CLOB_SUMMARY CLOB;
BEGIN
<<<채번과 구분코드값등을 가져오는 과정은 생략>>>
SELECT LISTAGG(CONF_MNG_WRITE_TITLE, '<br>') WITHIN GROUP (ORDER BY CONF_MNG_WRITE_TITLE)
INTO V_FILE_MNG_CODE
FROM SCEP_WRITE_APP
WHERE 1=1
AND STATE_CODE = '2'
AND DEPT_CD IN
(SELECT DEPT_CODE
FROM KPXJOJIK
WHERE 1=1
AND UP_CODE =
(SELECT UP_CODE
FROM KPXJOJIK
WHERE 1=1
AND DEPT_CODE = V_DEPT_CD
)
);
<<<글제목 합치기>>>
DBMS_OUTPUT.PUT_LINE('V_FILE_MNG_CODE>>>'||V_FILE_MNG_CODE||'<<<');
DBMS_OUTPUT.PUT_LINE('>>> CLOB SELECT <<<');
SELECT CONTENT
INTO V_SUM_CONTENT
FROM SCEP_WRITE_APP
WHERE 1=1
AND STATE_CODE = '2'
AND DEPT_CD IN (SELECT DEPT_CODE
FROM KPXJOJIK
WHERE 1=1
AND UP_CODE = (SELECT UP_CODE
FROM KPXJOJIK
WHERE 1=1
AND DEPT_CODE = V_DEPT_CD
)
);
<<< CLOB컬럼내용 select >>>
DBMS_OUTPUT.PUT_LINE('V_SUM_CONTENT>>>'||V_SUM_CONTENT||'<<<');
SELECT CONCAT(V_SUM_CONTENT,'<br>')
INTO V_CLOB_SUMMARY
FROM DUAL;
<<< CLOB컬럼 합치기하려 함 >>>
DBMS_OUTPUT.PUT_LINE('V_CLOB_SUMMARY>>>'||V_CLOB_SUMMARY||'<<<');
INSERT INTO SCEP_SUMMARY_APP
(
SUM_DATE
, UP_DEPT_CD
, POINT_GUBUN
, FILE_MNG_CODE
, SUM_GUBUN
, SUM_REG_NO
, M_CHARGE_REG_NO
, M_REPORT_DATE
, SUM_CONTENT
)
VALUES
(
V_SUM_DATE
, V_UP_DEPT_CD
, V_POINT_GUBUN
, V_FILE_MNG_CODE
, V_SUM_GUBUN
, V_SUM_REG_NO
, V_CHARGE_REG_NO
, V_REPORT_DATE
, V_CLOB_SUMMARY
);
<<익셉션 생략<>>>
END SUMMARY_DATA;