bugfixes...
[mir.git] / source / mir / storage / Database.java
index a7c116b..37c322a 100755 (executable)
@@ -1011,7 +1011,9 @@ public class Database implements StorageObject {
                throws SQLException,StorageObjectException
        {
                long  startTime = System.currentTimeMillis();
-               String sql = "SELECT count(*) FROM "+ theTable + " where " + where;
+               String sql = "SELECT Count(*) FROM "+ theTable;
+               if (where != null && !(where.length() == 0))
+                 sql = sql + " where " + where;
                Connection con = null;
                Statement stmt = null;
                int result = 0;