Summary


In this chapter, you learned that

  • You may store a datetime using the DATE type. The DATE type stores the century, all four digits of a year, the month, the day, the hour (in 24- hour format), the minute, and the second.

  • You may use TO_CHAR() and TO_DATE() to convert between strings and dates and times.

  • The Oracle database always stores all four digits of a year, and will interpret two-digit years according to a set of rules. The best practice is for you to always supply all four digits of the year so that you don t get confused as to which year you mean.

  • You may use functions to get or process dates and times. An example is ADD_MONTHS( x , y ) , which returns the result of adding y months to x .

  • The Oracle9 i database introduced the ability to use different time zones. A time zone is an offset from the time in Greenwich, England. The time in Greenwich was once known as Greenwich Mean Time (GMT), but is now known as Coordinated Universal Time (UTC). You specify a time zone using either an offset from UTC or the name of the region.

  • The Oracle9 i database introduced the ability to store timestamps. A timestamp stores the century, all four digits of a year, the month, the day, the hour (in 24-hour format), the minute, and the second. The advantages of a timestamp over a DATE are a timestamp can store a fractional second, and a timestamp can store a time zone.

  • The Oracle9 i database introduced the ability to handle time intervals, which allow you to store a length of time. An example time interval is 1 year 3 months.

In the next chapter, you ll learn about SQL*Plus.




Oracle Database 10g SQL
Oracle Database 10g SQL (Osborne ORACLE Press Series)
ISBN: 0072229810
EAN: 2147483647
Year: 2004
Pages: 217

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net