Insert null value to a date field
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Insert null value to a date field

Hybrid View

  1. #1
    Join Date
    Mar 2002
    Posts
    14

    Insert null value to a date field

    How do you insert a null value into a date field? I've tried to use 'null' and ' ' but there's an error. How do you do it?

    Thanks in advance.

  2. #2
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712
    Just use null, nothing more, nothing less:
    Code:
    scott@oracle> create table d (dd date);
    
    Table created.
    
    scott@oracle> insert into d values(null);
    
    1 row created.
    Ales
    The whole difference between a little boy and an adult man is the price of toys

  3. #3
    Join Date
    Mar 2002
    Posts
    14
    Thanks for the answer



  4. #4
    Join Date
    Feb 2001
    Posts
    180
    In case of nulls it is a good practice to use
    explicit conversion:
    insert into d values(to_date(null));
    Regards
    Ben de Boer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width