How to check if a cursor has results?

Original text of this message