declare v_empno scott.emp.empno%type; v_sal scott.emp.sal%type; cursor cur_emp(v_empno number default 7369) is select t.empno, t.sal from scott.emp t where t.empno = v_empno; begin open cur_emp(7566); loop fetch cur_emp into v_empno, v_sal; exit when cur_emp%notfound; dbms_output.put_line(v_empno || ‘ ‘ || v_sal); end loop; close cur_emp; end;
时间: 2024-12-17 07:02:35