title: Identifier must be declared? PL/SQL error
body: <p>This is the program I wrote:</p>
  
  <pre><code>set serveroutput on;
  declare
    b empl.name1%type;
    r varchar;   --can i change this to r empl.designation%type; ?
  begin
    r:=&amp;designation;                      --getting input for the designation
    dbms_output.put_line('hello');            --random output to check for errors
    select name1 into b from empl where designation=r;   --i want all the names from the table
    dbms_output.put_line('name'||b);                   --employee where designation is as entered
    dbms_output.put_line(' closed');                 --by user,should i loop this statement?
  end;
  </code></pre>
  
  <p>When I enter designation as 'a' (which is entered in the table already) I get an error
  <code>identifier 'a' is not declared</code>.   What does that mean?
  Does the select statement take one row at a time?  So if I loop it will I get all the rows?  Or should i use a cursor?
  Why does SQL Developer not accept <code>%rowtype</code>?</p>
  
  <p>I changed my program to this:</p>
  
  <pre><code>set serveroutput on;
  declare
    cursor cempl is select name1,designation from empl;
    b empl.name1%type;
    des empl.designation%type;
    r empl.designation%type;
  begin
    r:='meow';
    dbms_output.put_line('hello');
    open cempl;
    if cempl%ISOPEN then
      loop
        fetch cempl into b,des;
        if des=r then
          dbms_output.put_line('name'||b);
        end if;
        exit when cempl%notfound;
      end loop;
      close cempl;
      dbms_output.put_line(' closed');
    end if;
  end;
  </code></pre>
  
  <p>Whenever I get an input like <code>r:=&amp;r</code> and imagine I enter 'a' it says
  identifier 'a' must be declared, but its a value in the table! Why should it be declared, but if its given in the program like above it doesn't give an error.  Instead it repeats the last row twice!</p>