OQLQuery query = db.getOQLQuery(
"CALL SQL select PTF_SERVICE.ID as ID "
+ "from PTF_SERVICE order by PTF_SERVICE.ID "
+ "AS " + OID.class.getName());
QueryResults results = query.execute(Database.READONLY);
long result = System.currentTimeMillis();
int count = 0;
while (results.hasMore()) {