title: PLSQL Error : component must be declared
body: <p>It is probably a lame error but I do not find it.
  In a procedure I have this :</p>
  
  <pre><code>PROCEDURE myProcedure(returnCode OUT NUMBER) IS
  CURSOR myCursor IS
    SELECT column1, column2, column3, column4 FROM MyTable WHERE columX IS NULL AND columnY = 'PS';
  
  TYPE myType IS RECORD (
    name1 MyTable.Column1%TYPE,
    name2 MyTable.Column2%TYPE,
    name3 MyTable.Column3%TYPE,
    name4 MyTable.Column4%TYPE
  );
  
  
  myVar myType;
  myVar2 typeA
  
  BEGIN
     FOR myVar IN myCursor
     LOOP
        myVar2 := myVar.name2;
     END LOOP;
  END;
  </code></pre>
  
  <p>ERROR : </p>
  
  <pre><code>PLS-00302 component name2 must be declared
  </code></pre>
  
  <p>What is wrong?</p>
  
  <p>Ty</p>