1. Q: DATE datatype in Oracle7
I'm confused about the DATE datatype in Oracle7:
========================================
The Oracle7 Server Concepts Manual says:
========================================
DATE Datatype
-------------
The DATE datatype stores point-in-time values (dates and times) in a table. The
DATE datatype stores the year (including the century), the month, the day, the
hours, the minutes, and the seconds (after midnight). Oracle can store dates
ranging from Jan 1, 4712 BC through Dec 31, 4712 AD.
Unless you specifically specify BC, AD date entries are the default.
Oracle uses its own internal format to store dates. Date data is stored in
fixed-length fields of seven bytes each, corresponding to century, year,
month, day, hour, minute, and second.
============================
HOWEVER (try the following):
============================
create table t_date
(
d date
)
insert into t_date values
(
to_date( '9999-12-31 00:00:00', 'YYYY-MM-DD HH24:MI:SS' )
)
1 row processed.
update t_date set d = d + 1
ORA-01841: (full) year must be between -4713 and +9999, and not be 0
insert into t_date values
(
to_date( '-4712-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS' )
)
1 row processed.
update t_date set d = d - 1
ORA-01841: (full) year must be between -4713 and +9999, and not be 0
delete from t_date
insert into t_date values
(
to_date( '0000-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS' )
)
ORA-01841: (full) year must be between -4713 and +9999, and not be 0
insert into t_date values
(
to_date( '0001-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS' )
)
1 row processed.
update t_date set d = d - 366
1 row processed.
select SUBSTR( TO_CHAR( d, 'SYYYY-MM-DD HH24:MI:SS' ), 1, 20 ) AS timestamp
from t_date
TIMESTAMP
--------------------
0000-01-01 00:00:00
==============================
Results:
==============================
Oracle (7.3.3.4) accepts years in the range:
-4713 < YYYY <= 9999
but the documentation says:
-4713 < YYYY <= 4712
Also, the year 0 causes an error on insert
(I think, that's a correct behavior), but
allows it to be calculated (via update).
Where is the bug, where is the feature?
Steffen
2. Binding ADO RS created in code to a datagrid....
3. Oracle7, Personal Oracle7 on same client
4. SQL 7.0 Temp
5. Oracle7 Server and Oracle7 Workgroup Server for Windows NT
6. pgsql/src/backend/utils/misc guc-file.l
7. DTS Oracle7->MSSQL7 connection problem
8. Delete from table with Identity Column
9. Problems With Accessing Personal Oracle7 in Windows95 through VB
10. Oracle7 & VB5(sp3) problem
11. VB4 Oracle7 ODBC - Problems connecting from VB IDE
12. Problems Printing w/Crystal, VB, Oracle7
13. connect problem w/ oracle7.3