title: Oracle SQL Function: Adding local variables
body: <p>In a stored PROCEDURE, I can add the <code>v_bar</code> local variable as follow:</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE A_PROC (
      foo        VARCHAR2
  )
  
  AS 
      v_bar  VARCHAR2(32);  
  
  BEGIN
  
      SELECT FOO into v_bar WHERE ...;
  
  END A_PROC ;
  </code></pre>
  
  <p><strong>Question</strong></p>
  
  <p>How should <code>v_bar</code> be declared in the function below ?</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION A_FUNC(
      foo        VARCHAR2
  ) RETURN NUMBER AS total NUMBER;
  
  BEGIN
    -- Where to declare v_bar ?
    v_bar := 'bla';
  
  END A_FUNC;
  </code></pre>