December 2010
Intermediate to advanced
451 pages
11h 16m
English
You want to associate a time zone with a given date and time in order to be more precise.
Create a code block that declares a field as type TIMESTAMP WITH TIME ZONE. Assign a TIMESTAMP to the newly declared field within the body of the code block. After doing so, the field that you declared will contain the date and time of the TIMESTAMP that you assigned along with the associated time zone. The following example demonstrates a code block that performs this technique using the SYSTIMESTAMP:
DECLARE
time TIMESTAMP WITH TIME ZONE;
BEGIN
time := SYSTIMESTAMP;
DBMS_OUTPUT.PUT_LINE(time);
END;
The results that will be displayed via the call to DBMS_OUTPUT should resemble ...
Read now
Unlock full access