title: PL/SQL embedding SELECT into function
body: <p>I'm trying to embed a simple SELECT statement inside of a stored function, but it seems to be throwing these errors:</p>
  
  <blockquote>
    <p>SQL Statement Ignored (line 9)</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>Missing left parenthesis (line 12)</p>
  </blockquote>
  
  <p>First off, why is it ignoring my select statement?
  And second off, I have no parentheses on line 12, so I don't understand how that error is even being thrown.</p>
  
  <p>But here is my stored function code nonetheless:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION tax_calc_sf
  (p_basketid IN NUMBER)
  RETURN NUMBER
  IS
    lv_taxamt_num NUMBER;
    lv_subtotal_num bb_basket.subtotal%TYPE;
    lv_taxrate_num bb_tax.taxrate%TYPE;
  BEGIN
    SELECT bb.subtotal, bt.taxrate
    INTO lv_subtotal_num, lv_taxrate_num
    FROM bb_basket bb
    JOIN bb_tax bt USING bt.state = bb.shipstate
    WHERE bb.idbasket = p_basketid;
  
    lv_taxamt_num := lv_subtotal_num*lv_taxrate_num;
    RETURN lv_taxamt_num;
  
  EXCEPTION
    WHEN NO_DATA_FOUND THEN
      RETURN 0;
  END;
  /
  </code></pre>