Databases Reference
In-Depth Information
example, adding .5 to a date value results in a date and time combination 12 hours later
than the initial value. Some examples of date arithmetic are:
12-DEC-07 + 10 = 22-DEC-07
31-DEC-2007:23:59:59 + .25 = 1-JAN-2008:5:59:59
As of Oracle9 i Release 2, Oracle also supports two INTERVAL datatypes, INTERVAL
YEAR TO MONTH and INTERVAL DAY TO SECOND, which are used for storing a
specific amount of time. This data can be used for date arithmetic.
Temporal validity
Oracle Database 12 c introduced a new concept related to dates called temporal validity.
This feature allows you to specify the time period when a particular row of data is valid.
For instance, a company might want to add a temporary address for a particular person
that would only be valid for a set period of time.
When you create a table, you indicate that the rows of the table will allow for temporal
validity, and you can then set a time, as well as a range of time, for each record. Subseā€
quent SQL statements can query for records with a time selection component, which
will use the values in the temporal validity columns.
The temporal validity functionality uses Flashback mechanisms for implementation,
which are described in Chapter 8 .
Other Datatypes
Aside from the basic character, number, and date datatypes, Oracle supports a number
of specialized datatypes:
RAW and LONG RAW
Normally, your Oracle Database not only stores data but also interprets it. When
data is requested or exported from the database, the Oracle Database sometimes
massages the requested data. For instance, when you dump the values from a
NUMBER column, the values written to the dump file are the representations of
the numbers, not the internally stored numbers.
The RAW and LONG RAW datatypes circumvent any interpretation on the part of
the Oracle Database. When you specify one of these datatypes, Oracle will store the
data as the exact series of bits presented to it. The RAW datatypes typically store
objects with their own internal format, such as bitmaps. Until Oracle Database 12 c ,
a RAW datatypecolumn could hold 2 KB, which was increased to 32K in that release.
Oracle recommends that you convert LONG RAW columns to one of the binary
LOB column types.
ROWID
The ROWID is a special type of column known as a pseudocolumn . The ROWID
pseudocolumn can be accessed just like a column in a SQL SELECT statement.
Search WWH ::




Custom Search