You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Outsource RowCount into TDBObject which calls TDBConnection.GetRowCount with a server and version specific query. Introduce SELECT COUNT(*) for MSSQL 2000.
RowsTotal := DataGrid.RootNodeCount // No need to fetch via SHOW TABLE STATUS
4946
-
elsecase DBObject.Connection.Parameters.NetTypeGroup of
4947
-
ngMySQL:
4948
-
RowsTotal := MakeInt(DBObject.Connection.GetVar('SHOW TABLE STATUS LIKE '+esc(DBObject.Name), 'Rows'));
4949
-
ngMSSQL:
4950
-
RowsTotal := MakeInt(DBObject.Connection.GetVar('SELECT SUM(rows) FROM sys.partitions WHERE index_id IN (0, 1) AND object_id = object_id('+esc(DBObject.Database+'.'+DBObject.Schema+'.'+DBObject.Name)+')'));
4951
-
ngPgSQL:
4952
-
RowsTotal := MakeInt(DBObject.Connection.GetVar('SELECT reltuples::bigint FROM pg_class AS c LEFT JOIN pg_namespace AS n ON (n.oid = c.relnamespace) WHERE c.relkind='+esc('r')+' AND n.nspname='+esc(DBObject.Database)+' AND c.relname='+esc(DBObject.Name)));
4953
-
else
4954
-
raise Exception.Create(MsgUnhandledNetType);
4955
-
end;
4946
+
else
4947
+
RowsTotal := DBObject.RowCount;
4956
4948
if RowsTotal > -1thenbegin
4957
4949
cap := cap + ': ' + FormatNumber(RowsTotal) + '' + _('rows total');
0 commit comments