Datetime & ISQL
Posted in 1994
I have this problem with 4GL / ISQL. Can anybody explain why ?
-----------------------------------------------------------
SELECT min(cycle_no)
FROM cycle WHERE manifest_cutoff > CURRENT
AND cycle_no UNITS HOUR + DATETIME(0:0) HOUR TO MINUTE > manifest_cutoff
# ^
# 1267: The result of a datetime computation is out of range.
#
-----------------------------------------------------------
but the following works :
SELECT cycle_no
FROM cycle WHERE manifest_cutoff > CURRENT
AND cycle_no UNITS HOUR + DATETIME(0:0) HOUR TO MINUTE > manifest_cutoff
-----------------------------------------------------------
It does not seem to make sense. If a number of rows can be selected,
it should be able to find the MIN !
isql -v gives
INFORMIX-SQL Version 4.11.UC1
-----------------------------------------------------------
DBSCHEMA Schema Utility INFORMIX-SQL Version 5.01.UD3
create table cycle
(
cycle_no smallint not null,
cust_chkpt_start datetime hour to minute not null,
cust_chkpt_end datetime hour to minute not null,
manifest_cutoff datetime hour to minute not null,
gway_start datetime hour to minute not null
);
Unload data is :
1|01:00|02:00|23:15|22:15|
2|02:00|03:00|00:15|23:15|
3|03:00|04:00|01:15|00:15|
4|04:00|05:00|02:15|01:15|
5|05:00|06:00|03:15|02:15|
6|06:00|07:00|04:15|03:15|
7|07:00|08:00|05:15|04:15|
8|08:00|09:00|06:15|05:15|
9|09:00|10:00|07:15|06:15|
10|10:00|11:00|08:15|07:15|
11|11:00|12:00|09:15|08:15|
12|12:00|13:00|10:15|09:15|
13|13:00|14:00|11:15|10:15|
14|14:00|15:00|12:15|11:15|
15|15:00|16:00|13:15|12:15|
16|16:00|17:00|14:15|13:15|
17|17:00|18:00|15:15|14:15|
18|18:00|19:00|16:15|15:15|
19|19:00|20:00|17:15|16:15|
20|20:00|21:00|18:15|17:15|
21|21:00|22:00|19:15|18:15|
22|22:00|23:00|20:15|19:15|
23|23:00|00:00|21:15|20:15|
24|00:00|01:00|22:15|21:15|
---------------------------
Ti Lian Hwang
DHL Int(Pte) Ltd Singapore
email : tilh@sin-co.sin-ro.dhl.com
---------------------------