TMYSQL51Connection Select Sum(FIELD)
Original Reporter info from Mantis: aurawin
-
Reporter name: Andrew Brunner
Original Reporter info from Mantis: aurawin
- Reporter name: Andrew Brunner
Description:
TMYSQL51Connection and Select Sum(FIELD) does not parse resulting field at all. Query.Fields.Count always zero.
Query.SQL.Text:='SELECT SUM(FIELDX) from mytable where ItemID=1';
Query.Prepare;
Try
Query.Open; // No problems here...
If not Query.EOF then begin // No problems here...
if Query.Fields.Count>0 then begin
Count:=Query.Fields[0].AsLargeInt; // Never happens!
end;
end;
Finally
Query.Close;
End;
Additional information:
I'm using this for quota enforcement so a quick fix would be appreciated.
Mantis conversion info:
- Mantis ID: 17661
- Fixed in revision: 17077 (#d08662c1)