PROCEDURE SP_DISTANCE_POINT(
P_YEAR_TERM IN VARCHAR2
,P_TERM IN VARCHAR2
,P_YEARLY_TRACK IN VARCHAR2
)
IS
CURSOR CHOICE_CUR IS
SELECT A.RESISTRATION_NO, SUBSTR(B.ZIPCODE,1,3) ZIPCODE, C.COLUMNB
FROM DORM.T_DORM_ENTER_SUBMIT A
INNER JOIN DORM.T_ADDRESS_BOOK B ON A.RESISTRATION_NO = B.RESISTRATION_NO
INNER JOIN DORM.T_CODE_MASTER C ON SUBSTR(B.ZIPCODE,1,3) = C.CODE_DETAIL
WHERE A.YEAR_TERM = P_YEAR_TERM
AND A.TERM = P_TERM
AND A.JOB_END = 'N'
AND A.REG_STATUS = '7'
AND B.ADDRESS_TYPE = '현재'
AND A.YEARLY_TRACK = NVL(P_YEARLY_TRACK,'N')
FOR UPDATE OF DISTANCE_POINT NOWAIT;
V_CHOICE_CUR CHOICE_CUR%ROWTYPE;
BEGIN
OPEN CHOICE_CUR;
LOOP
FETCH CHOICE_CUR INTO V_CHOICE_CUR;
EXIT WHEN CHOICE_CUR%NOTFOUND;
UPDATE T_DORM_ENTER_SUBMIT SET DISTANCE_POINT = TO_NUMBER(V_CHOICE_CUR.COLUMNB)
WHERE YEAR_TERM = vYEAR_TERM
AND TERM = vTERM
AND RESISTRATION_NO = V_CHOICE_CUR.RESISTRATION_NO;
END LOOP;
COMMIT;
CLOSE CHOICE_CUR;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
WHEN OTHERS
THEN
RAISE;
END SP_DISTANCE_POINT;
오라클 사용자 에러출력하기 (0) | 2011.03.05 |
---|---|
XML 자료를 오라클 DB에 입력하기 예제 (0) | 2011.02.11 |
자리수 설정해서 보여주기 (0) | 2011.02.09 |
엑셀셀이 숫자로 입력되어 있을 때 숫자를 문자로 일괄 변환하는 방법 (0) | 2011.02.08 |
오라클 구분자로 첫번째, 두번째, 세번째 문자 구하기 (0) | 2011.01.06 |
댓글 영역