title: Using Substitution variable in PL/SQL Code
body: <p>I am using SQL Developer and writing this PL/SQL code. But I am getting error, when i gave B as option. Please help.</p>
  
  <pre><code>SET SERVEROUTPUT ON
  
  accept q_grade char prompt 'EnterGrade: '
  DECLARE
  v_grade CHAR(1) := UPPER(&amp;q_grade);
  v_appraisal VARCHAR(20);
  
  BEGIN
  v_appraisal := CASE v_grade WHEN v_grade = 'A' THEN 'Excellent'
  WHEN v_grade = 'B' THEN 'Good'
  WHEN v_grade = 'C' THEN 'FAIL'
  ELSE 'NO SUCH GRADES'
  END;
  
  DBMS_OUTPUT.PUT_LINE ('Grade:  ' || v_grade  || ' Appraisal  ' ||v_appraisal);
  
  END;
  /
  </code></pre>
  
  <p>Error report:</p>
  
  <pre>
  ORA-06550: line 2, column 26:
  PLS-00201: identifier 'B' must be declared
  ORA-06550: line 2, column 9:
  PL/SQL: Item ignored
  ORA-06550: line 6, column 21:
  PLS-00320: the declaration of the type of this expression is incomplete or malformed
  ORA-06550: line 6, column 1:
  PL/SQL: Statement ignored
  ORA-06550: line 12, column 57:
  PLS-00320: the declaration of the type of this expression is incomplete or malformed
  ORA-06550: line 12, column 21:
  PL/SQL: Statement ignored
  06550. 00000 -  "line %s, column %s:\n%s"
  *Cause:    Usually a PL/SQL compilation error.
  *Action:
  </pre>