title: Oracle PL/SQL block succeeds with hard coded value but not with variable
body: <p>The following PL/SQL successfully executes as expected:</p>
  
  <pre><code>declare
      myCount number;
  begin
      select count(*)
      into myCount
      from myTable
      where id = 1;
  end;
  </code></pre>
  
  <p>However, the following does not and instead throws this error:</p>
  
  <blockquote>
    <p>ORA-01422: exact fetch returns more than requested number of rows</p>
  </blockquote>
  
  <pre><code>declare
      myCount number;
      myId number := 1;
  begin
      select count(*)
      into myCount
      from myTable
      where id = myId;
  end;
  </code></pre>
  
  <p>Conceptually, I understand what the error means, but I don't know how it applies to my situation. All I've done is moved the hardcoded value to a variable in the <code>declare</code> block. Why would that affect the results of the <code>select</code> when it's the exact same number?</p>
  
  <p>Version is <code>Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production</code>.</p>