next_record called with no query pending: SELECT count(res_id) as anzahl FROM m_resource WHERE 1 and RES_FILE_STATUS = 1007