title: Check variable is null in if condition
body: <pre><code>CREATE OR REPLACE FUNCTION func
  RETURN varchar2 AS
  myvar INT;
  BEGIN
    select 1 into myvar  from dual where 1=2;
    IF  myvar  IS NULL THEN
      return 'n';
    ELSE
      return 'y';
    END IF;
  END;
  
  
  SELECT  func() FROM DUAL;
  </code></pre>
  
  <p>Why this function returns <code>NULL</code> instead of  string "n" ?</p>