Re: Date Formats within Informix.
Posted in 1996
John Brownlee (106005.3077@compuserve.com) wrote:
: We are using a format for a date of "DDMMMYYYY" in the form files of our
: system.
: I have tried unsuccessfully to use this Date format in the DBDATE
: environment
: variable, but it does not work
: [...]
: Informix :- SE ENGINE 5.06 & 4GL 4.14
The DBDATE environment variable should not affect this too much. I've
never tried this, but the release notes (Online 5.05 in my case) have
a section about this:
DATE MANIPULATION
=================
Beginning with Version 5.03, the date manipulation is handled in a
more flexible way: if you insert a string value which includes
a 3-letter month (e.g. "Dec 25 94") into a date column, the date
string is searched for any alphabetic month name first and then
the other components are identified. For example,
create table tab( c1 date);
insert into tab values("Dec 25 94");
will no longer return error -1218 and the correct value will be
inserted.
insert into tab values("25 Dec 94");
insert into tab values("xxxDecxxx 25 94");
will also work, even with default DBDATE "mdy4/". the correct value
of "Dec 25 94" will be inserted.
If your DBDATE is set to "mdy2/" (allocating 2 digits for the year)
and you "insert into tab values("12/31/1994")", the date will be
accepted and SELECT will return 2 digits for the year to match
the desired DBDATE format.
As a result of this bug fix, in some cases where you would have
received error codes -1204 or -1205, you will receive error
code -1218. In addition, the following ESQL/C call will not return
error code -1218 and instead will convert the date properly:
rstrdate("Dec 25 94", &dt);
This change is propagated in all the Embedded and Server products.
Have you read in your release notes about this? I'll install 5.07 this
weekend, and the release notes there say the same.
Hope this helps,
Richard
--
+----------------------------+-------------------------------------------+
| Dr. Richard Spitz | INTERNET: spitz@ana.med.uni-muenchen.de |
| EDV-Gruppe Anaesthesie | Tel : +49-89-7095-3413 |
| Klinikum Grosshadern | FAX : +49-89-7095-8886 |
| 81366 Munich, Germany | |
+----------------------------+-------------------------------------------+