title: Why is my IF being ignored in my PL?SQL script?
body: <p>When I run my script, I enter N when it asks "Will the payment method be cash (Y/N)?" but it still executes the statements under the IF...Why is this happening?</p>
  
  <pre><code>ACCEPT ExpNum NUMBER PROMPT 'Enter an expense number:  ';
  
  SELECT *
  FROM ExpByCC
  WHERE ExpNum = &amp;ExpNum;
  
  SELECT IsCash,CashAmt
  FROM EXPMAST
  WHERE ExpNum = &amp;ExpNum
  AND IsCash = 'Y';
  
  ACCEPT CashChoice PROMPT 'Will the payment method be cash (Y/N)?  ';
  
  DECLARE
      ChoiceCash VARCHAR2(1);
      NumRowInExpByCC NUMBER;
  BEGIN
      ChoiceCash := &amp;CashChoice;
  
      IF ChoiceCash = 'Y'
      THEN
              UPDATE EXPMAST
              SET IsCash =  ChoiceCash,
                  CashAmt = &amp;CashAmount
              WHERE ExpNum = &amp;ExpNum;
              COMMIT;
      ELSE
              &amp;CType;
              &amp;CCnum;
              &amp;Amt;
  
      END IF;
  
  END;
  /
  </code></pre>