title: Proper way of checking if row exists in table in PL/SQL block
body: <p>I was writing some tasks yesterday and it struck me that I don't really know <strong>THE PROPER and ACCEPTED way</strong> of checking if row exists in table when I'm using  PL/SQL.</p>
  <p>For examples sake let's use table:</p>
  <pre><code>PERSON (ID, Name); 
  </code></pre>
  <p>Obviously I <strong>can't do</strong> (unless there's some secret method) something like:</p>
  <pre><code>BEGIN 
    IF EXISTS SELECT id FROM person WHERE ID = 10; 
      -- do things when exists
    ELSE
      -- do things when doesn't exist
    END IF;
  END;
  </code></pre>
  <p>So my standard way of solving it was:</p>
  <pre><code>DECLARE
    tmp NUMBER;
  BEGIN 
    SELECT id INTO tmp FROM person WHERE id = 10; 
    --do things when record exists
  EXCEPTION
    WHEN no_data_found THEN
    --do things when record doesn't exist
  END; 
  </code></pre>
  <p>However I don't know if it's accepted way of doing it, or if there's any better way of checking, I would really apprieciate if someone could share their wisdom with me.</p>