Results 1 to 3 of 3

Thread: null

  1. #1
    Join Date
    Dec 2009
    Posts
    6

    Unanswered: null

    hello!
    im trying to insert data and i have trigger. where is a lot of columns there. how can i make insert null data on some of column (if there is no data for this column). i want that the other data will insert.
    thank you

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by anat1983 View Post
    how can i make insert null data on some of column (if there is no data for this column).
    Omit those columns from the INSERT statement.
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    As nick said... If the table consists of the following columns col1,col2,col3,col4,col5 and you want to insert col2 and col5 as null you can do it two ways.

    insert into my_table(col1,col2,col3,col4,col5) values(1,null,3,4,null);

    or

    insert into my_table(col1,col3,col4) values(1,3,4);
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Posting Permissions

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