Informix - Problem description
Problem IT09078 | Status: Closed |
DOCUMENTATION IS VAGUE ON HOW TO SET A DATETIME DATATYPE WITH THE DEFAULT CLAUSE. | |
product: | |
INFORMIX SERVER / 5725A3900 / B70 - IDS 11.70 | |
Problem description: | |
Problem description Documentation is vague on how to set a DATETIME datatype with the DEFAULT Clause. To set it is needs to be written like this: datetimefield datetime year to fraction(3) default datetime(1971-01-01 00:00:00.000) year to fraction(3), The documentation leads you to believe that you could use: datetimefield datetime year to fraction(3) default datetime '1971-01-01 00:00:00.000' year to fraction(3) The 2nd option DOES NOT work. The error code could use some work also. It reports an error 201: A syntax error has occurred. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * Informix 11.70, 12.10 * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * See Problem Conclusion * **************************************************************** | |
Local Fix: | |
Solution | |
When you use the DEFAULT clause in a CREATE TABLE or ALTER TABLE statement, you can supply a literal DATETIME as a default value for a column. Include parentheses around the date value, for example: column_name DATETIME YEAR TO FRACTION(3) DEFAULT DATETIME(1971-01-01 00:00:00.000) YEAR TO FRACTION(3) | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 25.05.2015 09.06.2017 09.06.2017 |
Problem solved at the following versions (IBM BugInfos) | |
Problem solved according to the fixlist(s) of the following version(s) |