Results 1 to 5 of 5

Thread: Strange Data

  1. #1
    Join Date
    Jan 2009
    Posts
    153

    Unanswered: Strange Data

    Hi Experts,

    I have a timestamp column in which am getting null as result when i query through an application. I dont have direct access to the db and only way is through that appliation. I have checked the length of the column and its showing 4. i hope string null is not allowed in timestamp colum.

    Can anyone please tell me is there any particular date to which JAVA responds like this?

    TIA

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Timestamp columns should be length 10. I would guess that the column is question is not a Timestamp, but a string where they are putting a time into.

    Andy

  3. #3
    Join Date
    Jan 2009
    Posts
    153
    Thansk Andy,

    I have checked with the client and the datatype is DATE sorry for putting it as TIMESTAMP.

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Dates in DB2 are indeed length 4. If you are getting null back from this column, then it can be NULL, which means that there is no date value stored there. It is not stored as a string, it is stored as binary. The application should handle null values properly. It is doesn't, then it is a bug that needs to be fixed.

    Andy

  5. #5
    Join Date
    Jul 2009
    Location
    NY
    Posts
    963
    Instead of
    Select ... timestamp_column from The_table
    use
    Select ... coalesce(timestamp_column, CURRENT TIMESTAMP) from The_table
    Lenny

Posting Permissions

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