problem with SUM,COUNT etc. results in SQL
Posted: 18.03.2006, 03:08
Sorry if this is too stupid question (and sorry for my english too) I tried to find some solution but wasn't successful.
I am not able to obtain results of SQL functions like SUM,MAX, LAST_INSERT_ID() with IZStatement like You can see below
Part of my code:
when program executes it colaps and write error "row data is not available"
TZMySQLResultSet.FRowHandle=nil but I really don't know why. Can someone please please help?
I am not able to obtain results of SQL functions like SUM,MAX, LAST_INSERT_ID() with IZStatement like You can see below
Part of my code:
Code: Select all
var
sqlDotaz : string;
statement : IZStatement;
resultSet : IZResultSet;
begin
statement := dmCentral.dmCentralni.zCentrKonekt.DbcConnection.CreateStatement;
sqlDotaz := 'select Sum(pocet_volnych) from typ_materialu';
resultSet := Statement.ExecuteQuery(sqlDotaz);
sumVolnych := resultSet.GetLong(1);
Code: Select all
resultSet.GetLong(1);
TZMySQLResultSet.FRowHandle=nil but I really don't know why. Can someone please please help?