title: Declaring variable to SELECT INTO in a function
body: <p>How do i declare a variable to select into in SQL-DEVELOPER</p>
  
  <p>this is not working and i don't what the workaround would be</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION CORRESPONDING_DATE 
  (
    DATE_IN IN VARCHAR
  )
  
   RETURN  VARCHAR is out_date VARCHAR(250);
   tmp_current_yr_hday_start DATE;
   BEGIN
     DECLARE    
     SELECT hday_start into tmp_current_yr_hday_start from hday_period where year = TO_CHAR(DATE_IN, 'YYYY'); -- get the current year holiday start period date            
    RETURN (out_date);
  END CORRESPONDING_DATE;
  </code></pre>
  
  <p>Error messages are </p>
  
  <blockquote>
    <p>Error(11,3): PL/SQL: SQL Statement ignored</p>
    
    <p>Error(11,26): PLS-00201: identifier 'TMP_CURRENT_YR_HDAY_START' must
    be declared</p>
    
    <p>Error(11,52): PL/SQL: ORA-00904: : invalid identifier</p>
  </blockquote>