SQL-Error -294 in IDS 7.30
Posted in 1998
Hi group,
we try to upgrade our internal IDS 7.23 on NT 4.0 to 7.30.TC5.
While testing one of our applications we encountered differences
in SQL behaviour. In detail, we've got the following:
create table test
(makurzz char(8), datum date, zeit integer);
insert into test values ('Peter','11/27/98',30);
insert into test values ('Peter','11/26/98',45);
create procedure zeit_char(izeit integer) returning char(10);
define chzeit char(10);
define chhour, chmin char(3);
define ihour, imin integer;
if izeit <= 0 then
let chzeit = NULL;
return(chzeit);
end if;
let ihour = izeit / 60;
let imin = izeit - (ihour*60);
if ihour < 10 then
let chhour = '0' || ihour;
else
let chhour = ihour;
end if;
if ihour == 0 then
let chhour = '00';
end if;
if imin < 10 then
let chmin = '0' || imin;
else
let chmin = imin;
end if;
if imin == 0 then
let chmin = '00';
end if;
let chzeit=trim(chhour)||':'||trim(chmin);
return chzeit;
end procedure;
select makurzz, zeit_char(zeit) from test; -- works fine
select makurzz, zeit_char(sum(zeit)) from test;returns 1): Peter 01:15 (on 7.23)
returns 2): sqlcode -294: The column ((expression)) must be in the
GROUP BY list.
Of course there is no way to put (expression) into the GROUP BY.
And, as stated abouve: it works fine on version < 7.30.
Is this a bug?
Is there a way to get the correct result without rewriting application
(Centura, SQL-Windows) und lots of Reports (MS-Access, ...)?
Did anybody encounter other SQLs that worked on earlier versions and
won't run on 7.30?
Thanks, Peter
--
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/_/ Mag. Peter Kolmhofer __ _ _____ _/
_/_/ Informix & DB2 DBA __ --/_|___\\______ _/
_/_/ Porsche Informatik (Austria) _ _ ( _ _ \\) _/
_/_/ A-5101 Bergheim, Handelszentrum 7 -(_)-------(_)- _/
_/_/ +43 662 4670-6258 fax: -6501 email:kop@porsche.co.at _/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/