2012년 6월 21일 목요일

대량 Update


SET SERVEROUTPUT ON;
DECLARE
   CURSOR cursor1 IS
        SELECT calibrationid, entrustdate, calagency, 'GG'  outpath, ADD_MONTHS(entrustdate, 3) inexpdate  FROM CALIBRATION
        WHERE 1 = 1
        AND ...       
BEGIN
    FOR cursor_rec1  IN cursor1 LOOP
        UPDATE calibration SET
            outdate = cursor_rec1.entrustdate,
            ...
        WHERE calibrationid = cursor_rec1.calibrationid;
   
    END LOOP;
END;

댓글 없음:

댓글 쓰기