title: pl/sql: Component 'X' must be declared
body: <p>The below code appears to be ok. But now sure why it is throwing that error.</p>
  
  <pre><code>DECLARE
    CURSOR cur IS
      SELECT name, salary, deptname 
      FROM emp_dept_view;
  
      TYPE st IS RECORD( n VARCHAR2(30), s NUMBER(7), d VARCHAR2(30));
      rec st;
  BEGIN
    FOR rec IN cur LOOP
      dbms_output.put_line(rec.n);
    END LOOP;
  END;
  
  ERROR at line 10:
  ORA-06550: line 10, column 26:
  PLS-00302: component 'N' must be declared
  ORA-06550: line 10, column 1:
  PL/SQL: Statement ignored
  </code></pre>