title: How to check if a result set is empty?
body: <p>I have a sql statement that returns no hits. For example, <code>'select * from TAB where 1 = 2'</code>.</p>
  
  <p>I want to check how many rows are returned, </p>
  
  <pre><code>cursor.execute(query_sql)
  
  rs = cursor.fetchall()
  </code></pre>
  
  <p>Here I get already exception: "(0, 'No result set')" </p>
  
  <p>How can I prevend this exception, check whether the result set is empty?</p>