insert statement
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: insert statement

  1. #1
    Join Date
    Apr 2003
    Posts
    8

    insert statement

    Hi
    I was wondering when I write an insert statement how do I leave a date field blank( Not Null Date) and also the number field (NOT NULL NUMBER) blank.
    thanks,
    bvg

  2. #2
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    try one of these ...

    SQL> create table my_table (col1 char(1),col2 number,col3 date);

    Table created.

    SQL> insert into my_table (col1) values ('A');

    1 row created.

    SQL> insert into my_table (col1,col2,col3) values ('A',null,null);

    1 row created.

    SQL> insert into my_table (col1,col2,col3) values ('A',to_number(null),
    2 to_date(null));

    1 row created.

    SQL> select * from my_table;

    C COL2 COL3
    - ---------- ---------
    A
    A
    A

    SQL>
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  3. #3
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    bvg, are the columns defined as NOT NULL? If so, you can't leave them blank . . .
    "The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman

  4. #4
    Join Date
    Apr 2003
    Posts
    8
    thank you so much DAV and DAPI for the info.

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