学习 动态游标的疑问

静态游标能用for in 语句
DECLARE
CURSOR V_COR IS SELECT * FROM EMPLOYEES;
V_ROW EMPLOYEES%ROWTYPE;
BEGIN
  FOR V_ROW IN V_COR LOOP
    DBMS_OUTPUT.put_line(V_ROW.NAME);
    END LOOP;
END;

为什么动态游标就不能 用 for in 语句呢
DECLARE
TYPE COR_TYPE IS REF CURSOR;
V_COR COR_TYPE;
V_ROW EMPLOYEES%ROWTYPE;
BEGIN
  OPEN V_COR FOR SELECT * FROM EMPLOYEES;
  FOR V_ROW IN V_COR  LOOP
    DBMS_OUTPUT.put_line(V_ROW.NAME);
    END LOOP;
    END;

猜你喜欢

转载自you2790.iteye.com/blog/1637737
今日推荐