VERY URGENT: why this behaviour?
Posted in 2000
whe submit the following sql statement to an IDS2000 (release 9.21) server:
select a.id_cen_originatore,
a.cd_tipo_messaggio,
a.dt_validita,
a.id_spe_trasmn,
a.id,
b.tempo_permanenza
FROM Gruppo_Report a,
Tipo_Messaggio b
WHERE a.cd_tipo_messaggio=b.cd_tipo_messaggio
and a.dt_inserimento+b.tempo_permanenza units hour<'2000-08-29 12:00:00'
it returns the following error:
--1268: invalid datetime or interval qualifier
please consider the following aspects:
1) if we submit the same statement to a database where the table
Gruppo_Report ie empty, it WORKS and return the statement "no data
returned";
2) if we submit the same statement to a 7.31 dynamic server, it WORKS and
returns the expected data;
3) if we substitute the expression "a.dt_inserimento+b.tempo_permanenza
units hour" with an integer, as following, it WORKS (and returns the
expected data)
select a.id_cen_originatore,
a.cd_tipo_messaggio,
a.dt_validita,
a.id_spe_trasmn,
a.id,
b.tempo_permanenza
FROM Gruppo_Report a,
Tipo_Messaggio b
WHERE a.cd_tipo_messaggio=b.cd_tipo_messaggio
and a.dt_inserimento+12 units hour<'2000-08-29 12:00:00'
4) The queries:
select b.tempo_permanenza units hour
FROM Gruppo_Report a,
Tipo_Messaggio b;
select b.tempo_permanenza
FROM Gruppo_Report a,
Tipo_Messaggio b;
return 12 as expected.
5) column dt_inserimento is a DATETIME year to second default CURRENT year
to second
6) column tempo_permanenza is an integer
what's wrong?
thank you all in advance
flavio gattari