Cast to integer or use fetchresultset