set sql_mode=oracle;
delimiter /
CREATE or replace PROCEDURE p1
AS
  a INT:=10;
  CURSOR cur1 IS SELECT a ;
BEGIN
  declare   
    rec1 cur1%ROWTYPE;
    CURSOR cur2 IS SELECT rec1.a ;
  begin
    declare 
      rec2 cur2%ROWTYPE;
    begin
      OPEN cur1;
      FETCH cur1 INTO rec1;
      CLOSE cur1;
      SELECT rec1.a;
      open cur2;
      FETCH cur2 INTO rec2;
      CLOSE cur2;
      SELECT rec2.a;  
    end;
  end;
END;
/
delimiter ;
SHOW PROCEDURE CODE p1;
call p1();
show warnings;