■ TIMESTAMP 데이터 타입 사용하기

------------------------------------------------------------------------------------------------------------------------

SET SERVEROUTPUT ON;

 

DECLARE

    V_CURRENT_DATE       DATE;

    V_CURRENT_TIMESTAMP1 TIMESTAMP;

    V_CURRENT_TIMESTAMP2 TIMESTAMP WITH TIME ZONE;

    V_CURRENT_TIMESTAMP3 TIMESTAMP WITH LOCAL TIME ZONE;

BEGIN

    V_CURRENT_DATE       := SYSDATE;

    V_CURRENT_TIMESTAMP1 := CURRENT_TIMESTAMP;

    V_CURRENT_TIMESTAMP2 := CURRENT_TIMESTAMP;

    V_CURRENT_TIMESTAMP3 := CURRENT_TIMESTAMP;

    

    DBMS_OUTPUT.PUT_LINE(V_CURRENT_DATE      ); -- 19/11/02

    DBMS_OUTPUT.PUT_LINE(V_CURRENT_TIMESTAMP1); -- 19/11/02 11:48:49.351000

    DBMS_OUTPUT.PUT_LINE(V_CURRENT_TIMESTAMP2); -- 19/11/02 11:48:49.351000 ASIA/SEOUL

    DBMS_OUTPUT.PUT_LINE(V_CURRENT_TIMESTAMP3); -- 19/11/02 11:48:49.351000

END;

------------------------------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요