Why is the return type of sysdate DATE? [closed]
Solution 1:
Looking back:
- Oracle version 2 was released in 1979.
- The American National Standards Institute adopted SQL as a standard in 1986.
- ISO 9075: "Information Technology Database Languages - SQL" was adopted in 1987.
- Oracle version 6 was released in 1988.
Therefore, Oracle's implementation of a DATE
data type predates the ANSI standard and Oracle chose to keep their original implementation rather than to break the backwards compatibility of the database versions to implement the ANSI/ISO standard.
But shouldn't date type only contain information on date and not on time.
The ANSI/ISO standard is for a DATE
to contain year, month and day components.
Oracle's implementation predates the ANSI/ISO standard and does not comply with it for historic reasons. It is a binary data type that consists of 7 bytes for century, year-of-century, month, day, hour, minute and second. It ALWAYS has those components.