VERY URGENT: why this behaviour?
Posted in 2000
Topics: General Discussion
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
Known bug 131554 Online error 1268 from select using datetime
expression specific to 9.2 (?)
OR
124437 ERROR 1268 USING A SIMPLE DATETIME EXPRESSION IN COLUMN LIST OF
SELECT Verified in 9.20.UC2
Workaround : Use extend function function to change the DATETIME type of
the resulting expression. The following statement works:
select date(extend(d + i units second, year to day))
from tab1;
OR
Flavio Gattari wrote in message <8pacda$395e$1@stargate1.inet.it>...
>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
>
>