SQL code -180 DATE, TIME, OR TIMESTAMP Value is Invalid

SQL error code -180 related to Date, Time and Timestamp. I am sharing the resolution for this.

-180
THE DATE, TIME, OR TIMESTAMP VALUE value IS INVALID

Explanation

The length or string representation of a DATE, TIME, or TIMESTAMP value does not conform to any valid format.

The value can contain one of the following:

  • For a host variable, the position number of the input host variable. If the position number cannot be determined, a blank is displayed.
  • For a character string constant, the character string constant. The maximum length that is displayed is the length of SQLERRM.
  • For a character column, the column name. If the column is a VIEW column and it has a corresponding base column, the VIEW column name is displayed. If the column is a VIEW column but it does not have a corresponding base column, a string of ‘*N’ is displayed.
    Otherwise, value is a string of ‘*N’.

System action

The statement cannot be processed.

Programmer response

Correct the program to ensure the specified value conforms to the syntax of DATE, TIME, and TIMESTAMP.

Ref:IBM

SQL Quiz

Do you want to perform better in next interview?

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.