Summary
In this chapter, you learned about the date and time data types supported by RDBMS Oracle, focusing on the differences between the ANSI standard and practical usage. Unlike other database systems, such as MySQL, Oracle does not support time management in separate data types. Additionally, year, month, and day elements cannot be treated without the time elements (hour, minute and second). DATE
and TIMESTAMP
values can be created by the ANSI constructors focusing on the specific format. It takes the finer element granularities in the right part of the definition. Thus, the year element is preceded by the month, which is preceded by the day reference. Another solution is defined by the explicit constructor function from the string, referenced by the TO_DATE
and TO_TIMESTAMP
functions.
To ensure the reliability and correctness of the results, a discussion related to implicit conversions was presented. Storing date or time elements as a string or integer does not provide sufficient...