Solved

will Oracle allow one to store a date of space/zero/null?

Posted on 2004-08-24
4
882 Views
Last Modified: 2008-01-09
will Oracle allow one to store a date of space/zero/null?
0
Comment
Question by:bolicat
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
pratikroy earned 125 total points
ID: 11880889
It will allow to store NULL in the date.
0
 
LVL 7

Expert Comment

by:bvanderveen
ID: 11880947
AS long as you don't have a NOT NULL constraint, you can update a column to null or leave it null when created.

Can't store zero or space, though.
0
 
LVL 9

Expert Comment

by:pratikroy
ID: 11880964
SQL> create table tab_dates (dt1 date);

Table created.

SQL> insert into tab_dates values to_date('00-00-00','DD-MM-YY');
insert into tab_dates values to_date('00-00-00','DD-MM-YY')
                             *
ERROR at line 1:
ORA-03001: unimplemented feature


SQL> insert into tab_dates values to_date('  -  -  ','DD-MM-YY');
insert into tab_dates values to_date('  -  -  ','DD-MM-YY')
                             *
ERROR at line 1:
ORA-03001: unimplemented feature


SQL> insert into tab_dates values (NULL);

1 row created.

SQL> insert into tab_dates values (sysdate);

1 row created.

SQL> select * from tab_dates;

DT1
---------

24-AUG-04

SQL> select * from tab_dates where dt1 is null;

DT1
---------


0
 
LVL 15

Expert Comment

by:andrewst
ID: 11880967
0 and space are meaningless in the context of a DATE column.  Sometimes people use a date like TO_DATE('01-JAN-0001','DD-MON-YYYY') as a kind of "zero" date.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now