Re: NVL changing data type of a datetime?
- From: Jonathan Leffler <jleffler@xxxxxxxxxxxxx>
- Date: Mon, 05 Dec 2005 15:06:48 GMT
jbesson wrote:
The 9.40 manual has exactly the same explanation of NVL, which is pretty vague, but I agree that the new 9.40 UC7 behaviour seems "more correct".
I've played some more with datetimes and also char columns and it seems to me that the "old" behaviour of NVL with datetimes is anomolous.
With chars, the data type returned is that of the longest argument, i.e. NVLing a char(3) and a char(5) always gives you a char(5) value - no matter which way round the arguments are and no matter which is null or not. This is consistent with all versions of Informix I've tried.
On the other hand, with datetimes (for all versions I've tried apart from 9.40.UC7), the data type returned is that of the first argument. IDS 9.40.UC7 behaves the same way as it does for chars, i.e. it takes the higher precision data type.
Although the 9.40 UC7 way seems better, it does mess up our code. I'm trying to get my hands on an installation of the latest 10.0 server to see if that has the new or old behaviour.
If, as I would suspect, the Informix team deliberately fixed the behaviour of NVL in 9.40.UC7, we almost certainly either already did or very shortly will put the same fix into IDS 10.00. it would be sensible to assume that the writing is on the wall - and fix your code to use CURRENT YEAR TO SECOND instead of just CURRENT. You might postpone the pain - mostly by coincidence - but that's all.
-- Jonathan Leffler #include <disclaimer.h> Email: jleffler@xxxxxxxxxxxxx, jleffler@xxxxxxxxxx Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/ .
- Follow-Ups:
- Re: NVL changing data type of a datetime?
- From: jbesson
- Re: NVL changing data type of a datetime?
- References:
- NVL changing data type of a datetime?
- From: jbesson
- Re: NVL changing data type of a datetime?
- From: Claus Samuelsen
- Re: NVL changing data type of a datetime?
- From: jbesson
- Re: NVL changing data type of a datetime?
- From: scottishpoet
- Re: NVL changing data type of a datetime?
- From: jbesson
- Re: NVL changing data type of a datetime?
- From: Jonathan Leffler
- Re: NVL changing data type of a datetime?
- From: jbesson
- NVL changing data type of a datetime?
- Prev by Date: Re: FW: Informix versus Oracle Spatial
- Next by Date: RE: Setting up informix on Fedora Core 4
- Previous by thread: Re: NVL changing data type of a datetime?
- Next by thread: Re: NVL changing data type of a datetime?
- Index(es):
Relevant Pages
|