Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
James Smith asked how to convert a float to an integer; his query with count() and an OUTER join returned 0.00000E00 for non-matching rows. Obnoxio The Clown suggested CAST. Jonathan Leffler suggested HEX or TRUNC(COUNT(...)), and asked whether DB-Access or DBD::Informix was involved, which might need a patch. No confirmation of a fix was given.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
James Smith — — source: Informix-list mailing list archive (1991-1998)
How can I convert a Float to and Integer?
↪ replying to James Smith
James Smith — — source: Informix-list mailing list archive (1991-1998)
The query looks like:
SELECT
m.match_id, m.home_team as team,
count( h.match_id ) as goals
FROM match m, OUTER goal h
WHERE m.match_type_id = 507
AND m.match_date = TODAY
AND m.match_id = h.match_id
AND m.home_team = h.team_id
GROUP BY m.match_id, m.home_team
It's the count() that returns 0.00000E00 when the entry in the goal
table in non-existent ( i.e. the team hasn't scored any goals in that
match ).
I need the count result to be an Integer.
"James Smith" <james@sportinglife.com> wrote in message
news:m98i6.11$kQ2.150@news.uk.colt.net...
> How can I convert a Float to and Integer?
>
>
↪ replying to James Smith
Obnoxio The Clown — — source: Informix-list mailing list archive (1991-1998)
In the year of Our Lord Tue, 13 Feb 2001 10:55:00 -0000, "James Smith"
<james@sportinglife.com> spake, saying:
>The query looks like:
>
> SELECT
> m.match_id, m.home_team as team,
> count( h.match_id ) as goals
> FROM match m, OUTER goal h
> WHERE m.match_type_id = 507
> AND m.match_date = TODAY
> AND m.match_id = h.match_id
> AND m.home_team = h.team_id
> GROUP BY m.match_id, m.home_team
>
>It's the count() that returns 0.00000E00 when the entry in the goal
>table in non-existent ( i.e. the team hasn't scored any goals in that
>match ).
>
>I need the count result to be an Integer.
>"James Smith" <james@sportinglife.com> wrote in message
>news:m98i6.11$kQ2.150@news.uk.colt.net...
>> How can I convert a Float to and Integer?
CAST?
↪ replying to Obnoxio The Clown
Jonathan Leffler — — source: Informix-list mailing list archive (1991-1998)
Obnoxio The Clown wrote:
>
> In the year of Our Lord Tue, 13 Feb 2001 10:55:00 -0000, "James Smith"
> <james@sportinglife.com> spake, saying:
>
> >The query looks like:
> >
> > SELECT
> > m.match_id, m.home_team as team,
> > count( h.match_id ) as goals
> > FROM match m, OUTER goal h
> > WHERE m.match_type_id = 507
> > AND m.match_date = TODAY
> > AND m.match_id = h.match_id
> > AND m.home_team = h.team_id
> > GROUP BY m.match_id, m.home_team
> >
> >It's the count() that returns 0.00000E00 when the entry in the goal
> >table in non-existent ( i.e. the team hasn't scored any goals in that
> >match ).
> >
> >I need the count result to be an Integer.
> >"James Smith" <james@sportinglife.com> wrote in message
> >news:m98i6.11$kQ2.150@news.uk.colt.net...
> >> How can I convert a Float to and Integer?
>
> CAST?
HEX? Or TRUNC(COUNT(h.match_id)) AS goals?
Don't use DB-Access? Or is it DBD::Informix you're up against, in which
case you probably need a patch first posted the better part of a year
ago?
--
Yours,
Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h>
Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN
"I don't suffer from insanity; I enjoy every minute of it!"
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.