Results 1 to 5 of 5
  1. #1
    Join Date
    May 2013
    Posts
    8

    Unanswered: does not like sysdate datatype

    Even if I take the second part out, it says invalid data type. Trying to add 2 fields to a table. First field empdate should be the systemdate. Second field should be the termination date, in which I should use whatever the current timestamp happens to be.

    Here's what I got and tried it with and without the default, but same thing. But even in examples, it takes the default.

    Alter TABLE employees
    ADD EmpDate (date sysdate,
    EndDate date current_timestamp);

    thanks

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    when all else fails Read The Fine Manual

    SQL Statements

    If you desire to establish a default value, then you must include the keyword "DEFAULT".
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    May 2013
    Posts
    8
    Thanks. Thats the website I needed

  4. #4
    Join Date
    May 2013
    Posts
    8
    Alter TABLE employees
    ADD (EmpDate Date DEFAULT SysDate, EndDate Date DEFAULT CURRENT_TIMESTAMP);

  5. #5
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

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